Use raw size for striped tiles

This commit is contained in:
Andrew Murray 2024-09-18 21:22:59 +10:00
parent a859695d9a
commit a92dca66bd

View File

@ -1569,7 +1569,7 @@ class TiffImageFile(ImageFile.ImageFile):
if STRIPOFFSETS in self.tag_v2:
offsets = self.tag_v2[STRIPOFFSETS]
h = self.tag_v2.get(ROWSPERSTRIP, ysize)
w = self.size[0]
w = xsize
else:
# tiled image
offsets = self.tag_v2[TILEOFFSETS]
@ -1603,9 +1603,9 @@ class TiffImageFile(ImageFile.ImageFile):
)
)
x = x + w
if x >= self.size[0]:
if x >= xsize:
x, y = 0, y + h
if y >= self.size[1]:
if y >= ysize:
x = y = 0
layer += 1
else: