mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 15:20:33 +03:00
Merge pull request #8723 from radarhere/tiff_iimm
This commit is contained in:
commit
c5d27af0f1
|
@ -780,15 +780,17 @@ class TestFileTiff:
|
||||||
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||||
b = BytesIO(data)
|
b = BytesIO(data)
|
||||||
with TiffImagePlugin.AppendingTiffWriter(b) as a:
|
with TiffImagePlugin.AppendingTiffWriter(b) as a:
|
||||||
|
a.seek(-4, os.SEEK_CUR)
|
||||||
a.writeLong(2**32 - 1)
|
a.writeLong(2**32 - 1)
|
||||||
assert b.getvalue() == data + b"\xff\xff\xff\xff"
|
assert b.getvalue() == data[:-4] + b"\xff\xff\xff\xff"
|
||||||
|
|
||||||
def test_appending_tiff_writer_rewritelastshorttolong(self) -> None:
|
def test_appending_tiff_writer_rewritelastshorttolong(self) -> None:
|
||||||
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||||
b = BytesIO(data)
|
b = BytesIO(data)
|
||||||
with TiffImagePlugin.AppendingTiffWriter(b) as a:
|
with TiffImagePlugin.AppendingTiffWriter(b) as a:
|
||||||
|
a.seek(-2, os.SEEK_CUR)
|
||||||
a.rewriteLastShortToLong(2**32 - 1)
|
a.rewriteLastShortToLong(2**32 - 1)
|
||||||
assert b.getvalue() == data[:-2] + b"\xff\xff\xff\xff"
|
assert b.getvalue() == data[:-4] + b"\xff\xff\xff\xff"
|
||||||
|
|
||||||
def test_saving_icc_profile(self, tmp_path: Path) -> None:
|
def test_saving_icc_profile(self, tmp_path: Path) -> None:
|
||||||
# Tests saving TIFF with icc_profile set.
|
# Tests saving TIFF with icc_profile set.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user