Merge pull request #4979 from radarhere/ifd

Added reading of IFD tag type
This commit is contained in:
Hugo van Kemenade 2020-10-14 17:43:41 +03:00 committed by GitHub
commit 04f1b38fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@ -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:

View File

@ -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"),
],
)
)

View File

@ -69,6 +69,7 @@ SIGNED_LONG = 9
SIGNED_RATIONAL = 10
FLOAT = 11
DOUBLE = 12
IFD = 13
TAGS_V2 = {
254: ("NewSubfileType", LONG, 1),