Support writing LONG8 offsets

This commit is contained in:
Andrew Murray 2024-09-25 18:45:16 +10:00
parent 0a99d63028
commit 24e9961c4f
2 changed files with 1 additions and 5 deletions

View File

@ -108,10 +108,6 @@ class TestFileTiff:
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
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")
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)

View File

@ -2123,7 +2123,7 @@ class AppendingTiffWriter(io.BytesIO):
def _fmt(self, field_size: int) -> str:
try:
return {2: "H", 4: "L"}[field_size]
return {2: "H", 4: "L", 8: "Q"}[field_size]
except KeyError:
msg = "offset is not supported"
raise RuntimeError(msg)