We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33ce014 commit 841ba16Copy full SHA for 841ba16
src/PIL/TiffImagePlugin.py
@@ -1608,6 +1608,10 @@ def _setup(self) -> None:
1608
raise ValueError(msg)
1609
w = tilewidth
1610
1611
+ if w == xsize and h == ysize and self._planar_configuration != 2:
1612
+ # Every tile covers the image. Only use the last offset
1613
+ offsets = offsets[-1:]
1614
+
1615
for offset in offsets:
1616
if x + w > xsize:
1617
stride = w * sum(bps_tuple) / 8 # bytes per line
@@ -1630,11 +1634,11 @@ def _setup(self) -> None:
1630
1634
args,
1631
1635
)
1632
1636
1633
- x = x + w
1637
+ x += w
1638
if x >= xsize:
1639
x, y = 0, y + h
1640
if y >= ysize:
- x = y = 0
1641
+ y = 0
1642
layer += 1
1643
else:
1644
logger.debug("- unsupported data organization")
0 commit comments