Set the length of ICC_PROFILE to 1

This is because the number of "values" returned is 1 (currently a tuple with only 1 value). I have a more extensive explanation in the issue #1462, and fixes that.
This commit is contained in:
Jesús Espino 2016-04-13 17:24:33 +02:00
parent ac6e1ef949
commit 128752e629

View File

@ -555,6 +555,10 @@ class ImageFileDirectory_v2(collections.MutableMapping):
if legacy_api and self.tagtype[tag] in [5, 10]:
values = values,
dest[tag], = values
elif tag == ICCPROFILE and self.tagtype[tag] == 7:
dest[tag], = values
elif tag == ICCPROFILE and self.tagtype[tag] == 1:
dest[tag] = bytes(values)
else:
dest[tag] = values