From 128752e62925a3a73d278ecec1ac2bb792562c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 13 Apr 2016 17:24:33 +0200 Subject: [PATCH] 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. --- PIL/TiffImagePlugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index 99beb0f97..971523df2 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -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