Skip to content

Commit

Permalink
Add strip chopping test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos committed Jun 2, 2021
1 parent 1a507d3 commit 1fc1440
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Tests/test_file_tiff.py
Expand Up @@ -4,7 +4,7 @@
import pytest

from PIL import Image, TiffImagePlugin
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION, STRIPOFFSETS

from .helper import (
assert_image_equal,
Expand Down Expand Up @@ -626,6 +626,12 @@ def test_string_dimension(self):
with pytest.raises(OSError):
im.load()

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


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

0 comments on commit 1fc1440

Please sign in to comment.