From 6b098a2c34300220bd0de4955f5a4951a9a75bf5 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 21 Apr 2021 22:37:47 +1000 Subject: [PATCH] Changed TIFF tag 33723 length to 1 --- Tests/test_file_tiff_metadata.py | 6 ++++++ src/PIL/TiffTags.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/test_file_tiff_metadata.py b/Tests/test_file_tiff_metadata.py index 0f7f8adf1..af7528be0 100644 --- a/Tests/test_file_tiff_metadata.py +++ b/Tests/test_file_tiff_metadata.py @@ -179,6 +179,12 @@ def test_no_duplicate_50741_tag(): assert TAG_IDS["BestQualityScale"] == 50780 +def test_iptc(tmp_path): + out = str(tmp_path / "temp.tiff") + with Image.open("Tests/images/hopper.Lab.tif") as im: + im.save(out) + + def test_empty_metadata(): f = io.BytesIO(b"II*\x00\x08\x00\x00\x00") head = f.read(8) diff --git a/src/PIL/TiffTags.py b/src/PIL/TiffTags.py index 088272162..d7f732193 100644 --- a/src/PIL/TiffTags.py +++ b/src/PIL/TiffTags.py @@ -178,7 +178,7 @@ TAGS_V2 = { 532: ("ReferenceBlackWhite", RATIONAL, 6), 700: ("XMP", BYTE, 0), 33432: ("Copyright", ASCII, 1), - 33723: ("IptcNaaInfo", UNDEFINED, 0), + 33723: ("IptcNaaInfo", UNDEFINED, 1), 34377: ("PhotoshopInfo", BYTE, 0), # FIXME add more tags here 34665: ("ExifIFD", LONG, 1),