Skip to content

Commit 26a188c

Browse files
authored
Simplify code in FpxImagePlugin.py (#9423)
2 parents 2a2638e + fd8fa7d commit 26a188c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/PIL/FpxImagePlugin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None:
141141

142142
size = i32(s, 4), i32(s, 8)
143143
# tilecount = i32(s, 12)
144-
tilesize = i32(s, 16), i32(s, 20)
144+
xtile, ytile = i32(s, 16), i32(s, 20)
145145
# channels = i32(s, 24)
146146
offset = i32(s, 28)
147147
length = i32(s, 32)
@@ -156,7 +156,6 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None:
156156

157157
x = y = 0
158158
xsize, ysize = size
159-
xtile, ytile = tilesize
160159
self.tile = []
161160

162161
for i in range(0, len(s), length):
@@ -224,7 +223,7 @@ def _open_subimage(self, index: int = 1, subimage: int = 0) -> None:
224223
msg = "unknown/invalid compression"
225224
raise OSError(msg)
226225

227-
x = x + xtile
226+
x += xtile
228227
if x >= xsize:
229228
x, y = 0, y + ytile
230229
if y >= ysize:

0 commit comments

Comments
 (0)