Simplify code in FpxImagePlugin.py (#9423)

This commit is contained in:
Hugo van Kemenade 2026-02-07 14:36:32 +02:00 committed by GitHub
commit 26a188c062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,7 @@ class FpxImageFile(ImageFile.ImageFile):
size = i32(s, 4), i32(s, 8)
# tilecount = i32(s, 12)
tilesize = i32(s, 16), i32(s, 20)
xtile, ytile = i32(s, 16), i32(s, 20)
# channels = i32(s, 24)
offset = i32(s, 28)
length = i32(s, 32)
@ -156,7 +156,6 @@ class FpxImageFile(ImageFile.ImageFile):
x = y = 0
xsize, ysize = size
xtile, ytile = tilesize
self.tile = []
for i in range(0, len(s), length):
@ -224,7 +223,7 @@ class FpxImageFile(ImageFile.ImageFile):
msg = "unknown/invalid compression"
raise OSError(msg)
x = x + xtile
x += xtile
if x >= xsize:
x, y = 0, y + ytile
if y >= ysize: