Skip to content

Commit

Permalink
Added additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 25, 2024
1 parent 24e9961 commit 7cf351c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/test_file_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,20 @@ def im_generator(ims: list[Image.Image]) -> Generator[Image.Image, None, None]:
with Image.open(mp) as reread:
assert reread.n_frames == 3

def test_fixoffsets(self) -> None:
b = BytesIO(b"II\x2a\x00\x00\x00\x00\x00")
with TiffImagePlugin.AppendingTiffWriter(b) as a:
b.seek(0)
a.fixOffsets(1, isShort=True)

b.seek(0)
a.fixOffsets(1, isLong=True)

# Neither short nor long
b.seek(0)
with pytest.raises(RuntimeError):
a.fixOffsets(1)

def test_saving_icc_profile(self, tmp_path: Path) -> None:
# Tests saving TIFF with icc_profile set.
# At the time of writing this will only work for non-compressed tiffs
Expand Down

0 comments on commit 7cf351c

Please sign in to comment.