Add tag info for iccprofile, fixes #1462

This commit is contained in:
wiredfool 2015-10-03 16:35:53 +01:00
parent ea437d36ca
commit 7729d88995
3 changed files with 12 additions and 1 deletions

View File

@ -133,6 +133,7 @@ TAGS_V2 = {
# FIXME add more tags here # FIXME add more tags here
34665: ("ExifIFD", 3, 1), 34665: ("ExifIFD", 3, 1),
34675: ('ICCProfile', 7, 1),
# MPInfo # MPInfo
45056: ("MPFVersion", 7, 1), 45056: ("MPFVersion", 7, 1),
@ -171,7 +172,6 @@ TAGS = {347: 'JPEGTables',
33437: 'FNumber', 33437: 'FNumber',
33723: 'IptcNaaInfo', 33723: 'IptcNaaInfo',
34377: 'PhotoshopInfo', 34377: 'PhotoshopInfo',
34675: 'ICCProfile',
34850: 'ExposureProgram', 34850: 'ExposureProgram',
34852: 'SpectralSensitivity', 34852: 'SpectralSensitivity',
34853: 'GPSInfoIFD', 34853: 'GPSInfoIFD',

Binary file not shown.

View File

@ -148,6 +148,17 @@ class TestFileTiffMetadata(PillowTestCase):
except struct.error: except struct.error:
self.fail("Should not be struct errors there.") 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__': if __name__ == '__main__':
unittest.main() unittest.main()