Skip to content

Commit 144959b

Browse files
authored
Merge pull request #2 from radarhere/dev-j2k-precision
Simplified code
2 parents 7ca9bdd + 0f49eaf commit 144959b

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/PIL/Jpeg2KImagePlugin.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,10 @@ def _parse_codestream(fp):
106106
lsiz, rsiz, xsiz, ysiz, xosiz, yosiz, _, _, _, _, csiz = struct.unpack_from(
107107
">HHIIIIIIIIH", siz
108108
)
109-
ssiz = [None] * csiz
110-
xrsiz = [None] * csiz
111-
yrsiz = [None] * csiz
112-
for i in range(csiz):
113-
ssiz[i], xrsiz[i], yrsiz[i] = struct.unpack_from(">BBB", siz, 38 + 3 * i)
114109

115110
size = (xsiz - xosiz, ysiz - yosiz)
116111
if csiz == 1:
112+
ssiz = struct.unpack_from(">B", siz, 38)
117113
if (ssiz[0] & 0x7F) + 1 > 8:
118114
mode = "I;16"
119115
else:

0 commit comments

Comments
 (0)