Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,10 @@
raise ValueError(msg)
w = tilewidth

if w == xsize and h == ysize and self._planar_configuration != 2:

Check warning on line 1611 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L1611

Added line #L1611 was not covered by tests
# Every tile covers the image. Only use the last offset
offsets = offsets[-1:]

Check warning on line 1613 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L1613

Added line #L1613 was not covered by tests

for offset in offsets:
if x + w > xsize:
stride = w * sum(bps_tuple) / 8 # bytes per line
Expand All @@ -1630,11 +1634,11 @@
args,
)
)
x = x + w
x += w

Check warning on line 1637 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L1637

Added line #L1637 was not covered by tests
if x >= xsize:
x, y = 0, y + h
if y >= ysize:
x = y = 0
y = 0

Check warning on line 1641 in src/PIL/TiffImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/TiffImagePlugin.py#L1641

Added line #L1641 was not covered by tests
layer += 1
else:
logger.debug("- unsupported data organization")
Expand Down
Loading