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 3, 2021
1 parent 1a507d3 commit d0e8feb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tests/test_file_libtiff.py
Expand Up @@ -9,7 +9,7 @@
import pytest

from PIL import Image, ImageFilter, TiffImagePlugin, TiffTags, features
from PIL.TiffImagePlugin import SUBIFD
from PIL.TiffImagePlugin import SUBIFD, STRIPOFFSETS

from .helper import (
assert_image_equal,
Expand Down Expand Up @@ -967,3 +967,10 @@ def test_realloc_overflow(self):
# Assert that the error code is IMAGING_CODEC_MEMORY
assert str(e.value) == "-9"
TiffImagePlugin.READ_LIBTIFF = False

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

0 comments on commit d0e8feb

Please sign in to comment.