Correct duplicate EXIF tags: http://www.exiv2.org/tags.html

This commit is contained in:
hugovk 2014-08-27 10:46:34 +03:00
parent ec2a225fff
commit d866a29bd8
2 changed files with 11 additions and 2 deletions

View File

@ -67,8 +67,8 @@ TAGS = {
0x0213: "YCbCrPositioning",
0x0214: "ReferenceBlackWhite",
0x1000: "RelatedImageFileFormat",
0x1001: "RelatedImageLength", # FIXME / Dictionary contains duplicate keys
0x1001: "RelatedImageWidth", # FIXME \ Dictionary contains duplicate keys
0x1001: "RelatedImageLength",
0x1002: "RelatedImageWidth",
0x828d: "CFARepeatPatternDim",
0x828e: "CFAPattern",
0x828f: "BatteryLevel",

View File

@ -295,6 +295,15 @@ class TestFileJpeg(PillowTestCase):
# Default save quality is 75%, so a tiny bit of difference is alright
self.assert_image_similar(img, Image.open(tempfile), 1)
def test_no_duplicate_0x1001_tag(self):
# Arrange
from PIL import ExifTags
tag_ids = dict(zip(ExifTags.TAGS.values(), ExifTags.TAGS.keys()))
# Assert
self.assertEqual(tag_ids['RelatedImageLength'], 0x1001)
self.assertEqual(tag_ids['RelatedImageWidth'], 0x1002)
if __name__ == '__main__':
unittest.main()