diff --git a/src/PIL/FpxImagePlugin.py b/src/PIL/FpxImagePlugin.py index 297971234d8..0b06aac965f 100644 --- a/src/PIL/FpxImagePlugin.py +++ b/src/PIL/FpxImagePlugin.py @@ -141,7 +141,7 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None: 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 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None: x = y = 0 xsize, ysize = size - xtile, ytile = tilesize self.tile = [] for i in range(0, len(s), length): @@ -224,7 +223,7 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None: msg = "unknown/invalid compression" raise OSError(msg) - x = x + xtile + x += xtile if x >= xsize: x, y = 0, y + ytile if y >= ysize: