Convert int values of RATIONAL TIFF tags to floats

This commit is contained in:
Andrew Murray 2018-09-07 20:35:55 +10:00
parent 4cfcc3b010
commit 0a44d58314

View File

@ -567,6 +567,9 @@ class ImageFileDirectory_v2(MutableMapping):
if self.tagtype[tag] == 7 and py3:
values = [value.encode("ascii", 'replace') if isinstance(
value, str) else value]
elif self.tagtype[tag] == 5:
values = [float(v) if isinstance(v, int) else v
for v in values]
values = tuple(info.cvt_enum(value) for value in values)