Skip to content

Commit aa9ecac

Browse files
committed
Added ImageSourceData to TAGS_V2
1 parent 3cd1e12 commit aa9ecac

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Diff for: Tests/test_file_libtiff.py

+5
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,11 @@ def test_save_ycbcr(self, tmp_path):
668668
assert reloaded.tag_v2[530] == (1, 1)
669669
assert reloaded.tag_v2[532] == (0, 255, 128, 255, 128, 255)
670670

671+
def test_save_imagesourcedata(self, tmp_path):
672+
outfile = str(tmp_path / "temp.tif")
673+
with Image.open("Tests/images/tiff_adobe_deflate.tif") as im:
674+
im.save(outfile)
675+
671676
def test_crashing_metadata(self, tmp_path):
672677
# issue 1597
673678
with Image.open("Tests/images/rdf.tif") as im:

Diff for: docs/releasenotes/9.5.0.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,18 @@ data to populate those resources.
7272
PpmImagePlugin might hold onto the last data read for a pixel value in case the
7373
pixel value has not been finished yet. However, that data was not being cleared
7474
afterwards, meaning that infinite data could be available to fill any image
75-
size.
75+
size. This has been present since Pillow 9.2.0.
7676

7777
That data is now cleared after use.
7878

79+
Saving TIFF tag ImageSourceData
80+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81+
82+
If Pillow incorrectly saved the TIFF tag ImageSourceData as ASCII instead of
83+
UNDEFINED, a segmentation fault was triggered.
84+
85+
The correct tag type will now be used by default instead.
86+
7987
Other Changes
8088
=============
8189

Diff for: src/PIL/TiffTags.py

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def lookup(tag, group=None):
195195
34675: ("ICCProfile", UNDEFINED, 1),
196196
34853: ("GPSInfoIFD", LONG, 1),
197197
36864: ("ExifVersion", UNDEFINED, 1),
198+
37724: ("ImageSourceData", UNDEFINED, 1),
198199
40965: ("InteroperabilityIFD", LONG, 1),
199200
41730: ("CFAPattern", UNDEFINED, 1),
200201
# MPInfo

0 commit comments

Comments
 (0)