Fix test with fraction exposure
This commit is contained in:
@@ -255,7 +255,8 @@ def get_exif_tags(data):
|
||||
exptime = data['ExposureTime']
|
||||
if isinstance(exptime, tuple):
|
||||
try:
|
||||
simple['exposure'] = str(fractions.Fraction(exptime[0], exptime[1]))
|
||||
simple['exposure'] = str(fractions.Fraction(exptime[0],
|
||||
exptime[1]))
|
||||
except IndexError:
|
||||
# Pillow == 3.0
|
||||
simple['exposure'] = exptime[0]
|
||||
|
||||
@@ -105,7 +105,10 @@ def test_get_exif_tags():
|
||||
assert simple['iso'] == 50
|
||||
assert simple['Make'] == 'NIKON'
|
||||
assert simple['datetime'] == 'Sunday, 22. January 2006'
|
||||
assert simple['exposure'] == 0.00100603
|
||||
if PIL.PILLOW_VERSION == '3.0.0':
|
||||
assert simple['exposure'] == 0.00100603
|
||||
else:
|
||||
assert simple['exposure'] == '100603/100000000'
|
||||
|
||||
data = {'FNumber': [1, 0], 'FocalLength': [1, 0], 'ExposureTime': 10}
|
||||
simple = get_exif_tags(data)
|
||||
|
||||
Reference in New Issue
Block a user