Skip to content

Commit c5d27af

Browse files
authored
Merge pull request #8723 from radarhere/tiff_iimm
2 parents 793e1fc + 5bbbc46 commit c5d27af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/test_file_tiff.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,15 +780,17 @@ def test_appending_tiff_writer_writelong(self) -> None:
780780
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
781781
b = BytesIO(data)
782782
with TiffImagePlugin.AppendingTiffWriter(b) as a:
783+
a.seek(-4, os.SEEK_CUR)
783784
a.writeLong(2**32 - 1)
784-
assert b.getvalue() == data + b"\xff\xff\xff\xff"
785+
assert b.getvalue() == data[:-4] + b"\xff\xff\xff\xff"
785786

786787
def test_appending_tiff_writer_rewritelastshorttolong(self) -> None:
787788
data = b"II\x2A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
788789
b = BytesIO(data)
789790
with TiffImagePlugin.AppendingTiffWriter(b) as a:
791+
a.seek(-2, os.SEEK_CUR)
790792
a.rewriteLastShortToLong(2**32 - 1)
791-
assert b.getvalue() == data[:-2] + b"\xff\xff\xff\xff"
793+
assert b.getvalue() == data[:-4] + b"\xff\xff\xff\xff"
792794

793795
def test_saving_icc_profile(self, tmp_path: Path) -> None:
794796
# Tests saving TIFF with icc_profile set.

0 commit comments

Comments
 (0)