diff --git a/Tests/images/ifd_tag_type.tiff b/Tests/images/ifd_tag_type.tiff new file mode 100644 index 000000000..316d2089e Binary files /dev/null and b/Tests/images/ifd_tag_type.tiff differ diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 594115042..bcffecd35 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -385,6 +385,10 @@ class TestFileTiff: ret = ifd.load_double(data, False) assert ret == (8.540883223036124e194, 8.540883223036124e194) + def test_ifd_tag_type(self): + with Image.open("Tests/images/ifd_tag_type.tiff") as im: + assert 0x8825 in im.tag_v2 + def test_seek(self): filename = "Tests/images/pil136.tiff" with Image.open(filename) as im: diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index ac309c560..bbfd28cc2 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -665,6 +665,7 @@ class ImageFileDirectory_v2(MutableMapping): (TiffTags.SIGNED_LONG, "l", "signed long"), (TiffTags.FLOAT, "f", "float"), (TiffTags.DOUBLE, "d", "double"), + (TiffTags.IFD, "L", "long"), ], ) ) diff --git a/src/PIL/TiffTags.py b/src/PIL/TiffTags.py index e1c1b701b..796ff3479 100644 --- a/src/PIL/TiffTags.py +++ b/src/PIL/TiffTags.py @@ -69,6 +69,7 @@ SIGNED_LONG = 9 SIGNED_RATIONAL = 10 FLOAT = 11 DOUBLE = 12 +IFD = 13 TAGS_V2 = { 254: ("NewSubfileType", LONG, 1),