Corrected tag counts (#4033)

Corrected tag counts
This commit is contained in:
Hugo van Kemenade 2019-09-05 22:41:16 +03:00 committed by GitHub
commit 572a93c86f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -239,11 +239,13 @@ class TestFileTiffMetadata(PillowTestCase):
def test_PhotoshopInfo(self): def test_PhotoshopInfo(self):
im = Image.open("Tests/images/issue_2278.tif") im = Image.open("Tests/images/issue_2278.tif")
self.assertIsInstance(im.tag_v2[34377], bytes) self.assertEqual(len(im.tag_v2[34377]), 1)
self.assertIsInstance(im.tag_v2[34377][0], bytes)
out = self.tempfile("temp.tiff") out = self.tempfile("temp.tiff")
im.save(out) im.save(out)
reloaded = Image.open(out) reloaded = Image.open(out)
self.assertIsInstance(reloaded.tag_v2[34377], bytes) self.assertEqual(len(reloaded.tag_v2[34377]), 1)
self.assertIsInstance(reloaded.tag_v2[34377][0], bytes)
def test_too_many_entries(self): def test_too_many_entries(self):
ifd = TiffImagePlugin.ImageFileDirectory_v2() ifd = TiffImagePlugin.ImageFileDirectory_v2()

View File

@ -175,9 +175,10 @@ TAGS_V2 = {
530: ("YCbCrSubSampling", SHORT, 2), 530: ("YCbCrSubSampling", SHORT, 2),
531: ("YCbCrPositioning", SHORT, 1), 531: ("YCbCrPositioning", SHORT, 1),
532: ("ReferenceBlackWhite", RATIONAL, 6), 532: ("ReferenceBlackWhite", RATIONAL, 6),
700: ("XMP", BYTE, 1), 700: ("XMP", BYTE, 0),
33432: ("Copyright", ASCII, 1), 33432: ("Copyright", ASCII, 1),
34377: ("PhotoshopInfo", BYTE, 1), 33723: ("IptcNaaInfo", UNDEFINED, 0),
34377: ("PhotoshopInfo", BYTE, 0),
# FIXME add more tags here # FIXME add more tags here
34665: ("ExifIFD", LONG, 1), 34665: ("ExifIFD", LONG, 1),
34675: ("ICCProfile", UNDEFINED, 1), 34675: ("ICCProfile", UNDEFINED, 1),