diff --git a/PIL/TiffTags.py b/PIL/TiffTags.py index 012d67632..af6d1b386 100644 --- a/PIL/TiffTags.py +++ b/PIL/TiffTags.py @@ -133,6 +133,7 @@ TAGS_V2 = { # FIXME add more tags here 34665: ("ExifIFD", 3, 1), + 34675: ('ICCProfile', 7, 1), # MPInfo 45056: ("MPFVersion", 7, 1), @@ -171,7 +172,6 @@ TAGS = {347: 'JPEGTables', 33437: 'FNumber', 33723: 'IptcNaaInfo', 34377: 'PhotoshopInfo', - 34675: 'ICCProfile', 34850: 'ExposureProgram', 34852: 'SpectralSensitivity', 34853: 'GPSInfoIFD', diff --git a/Tests/images/hopper.iccprofile.tif b/Tests/images/hopper.iccprofile.tif new file mode 100644 index 000000000..f4cfeab3e Binary files /dev/null and b/Tests/images/hopper.iccprofile.tif differ diff --git a/Tests/test_file_tiff_metadata.py b/Tests/test_file_tiff_metadata.py index f2197ad04..243d1a4f3 100644 --- a/Tests/test_file_tiff_metadata.py +++ b/Tests/test_file_tiff_metadata.py @@ -148,6 +148,17 @@ class TestFileTiffMetadata(PillowTestCase): except struct.error: self.fail("Should not be struct errors there.") + def test_iccprofile(self): + # https://github.com/python-pillow/Pillow/issues/1462 + im = Image.open('Tests/images/hopper.iccprofile.tif') + out = self.tempfile('temp.tiff') + + im.save(out) + reloaded = Image.open(out) + self.assert_(type(im.info['icc_profile']) is not type(tuple)) + self.assertEqual(im.info['icc_profile'], reloaded.info['icc_profile']) + + if __name__ == '__main__': unittest.main()