Skip to content

Commit 100299a

Browse files
kmilosradarhere
authored andcommitted
Add multiple strip saving test
1 parent 0ae2981 commit 100299a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Tests/test_file_libtiff.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010

1111
from PIL import Image, ImageFilter, TiffImagePlugin, TiffTags, features
12-
from PIL.TiffImagePlugin import SUBIFD
12+
from PIL.TiffImagePlugin import STRIPOFFSETS, SUBIFD
1313

1414
from .helper import (
1515
assert_image_equal,
@@ -967,3 +967,12 @@ def test_realloc_overflow(self):
967967
# Assert that the error code is IMAGING_CODEC_MEMORY
968968
assert str(e.value) == "-9"
969969
TiffImagePlugin.READ_LIBTIFF = False
970+
971+
def test_save_multistrip(self, tmp_path):
972+
im = hopper("RGB").resize((256, 256))
973+
out = str(tmp_path / "temp.tif")
974+
im.save(out, compression="tiff_adobe_deflate")
975+
976+
with Image.open(out) as im:
977+
# Assert that there are multiple strips
978+
assert len(im.tag_v2[STRIPOFFSETS]) > 1

0 commit comments

Comments
 (0)