mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 20:54:47 +03:00
Handle default value for RowsPerStrip TIFF tag
This commit is contained in:
parent
759c518420
commit
b541aff64a
BIN
Tests/images/one_strip.tif
Normal file
BIN
Tests/images/one_strip.tif
Normal file
Binary file not shown.
|
@ -869,6 +869,11 @@ class TestFileLibTiff(LibTiffTestCase):
|
|||
im.load()
|
||||
assert im.size == (950, 975)
|
||||
|
||||
def test_one_strip(self):
|
||||
with Image.open("Tests/images/one_strip.tif") as im:
|
||||
im.load()
|
||||
assert im.size == (1728, 2344)
|
||||
|
||||
def test_orientation(self):
|
||||
with Image.open("Tests/images/g4_orientation_1.tif") as base_im:
|
||||
for i in range(2, 9):
|
||||
|
|
|
@ -328,7 +328,10 @@ _decodeStrip(Imaging im, ImagingCodecState state, TIFF *tiff) {
|
|||
int ret;
|
||||
|
||||
ret = TIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &rows_per_strip);
|
||||
if (ret != 1) {
|
||||
if (
|
||||
ret != 1 ||
|
||||
rows_per_strip == 4294967295 // 2 ** 32 - 1, the default
|
||||
) {
|
||||
rows_per_strip = state->ysize;
|
||||
}
|
||||
TRACE(("RowsPerStrip: %u \n", rows_per_strip));
|
||||
|
|
Loading…
Reference in New Issue
Block a user