Skip to content

Commit 1fc1440

Browse files
committed
Add strip chopping test
1 parent 1a507d3 commit 1fc1440

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Tests/test_file_tiff.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
from PIL import Image, TiffImagePlugin
7-
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION
7+
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION, STRIPOFFSETS
88

99
from .helper import (
1010
assert_image_equal,
@@ -626,6 +626,12 @@ def test_string_dimension(self):
626626
with pytest.raises(OSError):
627627
im.load()
628628

629+
def test_strip_chop(self):
630+
# Test if a single strip image is loaded as chopped
631+
infile = "Tests/images/hopper.iccprofile.tif"
632+
with Image.open(infile) as im:
633+
assert len(im.tag_v2[STRIPOFFSETS]) > 1
634+
629635

630636
@pytest.mark.skipif(not is_win32(), reason="Windows only")
631637
class TestFileTiffW32:

0 commit comments

Comments
 (0)