mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-10 00:20:57 +03:00
Support writing LONG8 offsets
This commit is contained in:
parent
0a99d63028
commit
24e9961c4f
|
@ -108,10 +108,6 @@ class TestFileTiff:
|
||||||
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
|
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
|
||||||
|
|
||||||
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
|
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
|
||||||
# The data type of this file's StripOffsets tag is LONG8,
|
|
||||||
# which is not yet supported for offset data when saving multiple frames.
|
|
||||||
del im.tag_v2[273]
|
|
||||||
|
|
||||||
outfile = str(tmp_path / "temp.tif")
|
outfile = str(tmp_path / "temp.tif")
|
||||||
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)
|
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)
|
||||||
|
|
||||||
|
|
|
@ -2123,7 +2123,7 @@ class AppendingTiffWriter(io.BytesIO):
|
||||||
|
|
||||||
def _fmt(self, field_size: int) -> str:
|
def _fmt(self, field_size: int) -> str:
|
||||||
try:
|
try:
|
||||||
return {2: "H", 4: "L"}[field_size]
|
return {2: "H", 4: "L", 8: "Q"}[field_size]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
msg = "offset is not supported"
|
msg = "offset is not supported"
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user