Skip to content

Commit

Permalink
Merge pull request #2 from radarhere/dev-j2k-precision
Browse files Browse the repository at this point in the history
Simplified code
  • Loading branch information
scaramallion authored Mar 25, 2024
2 parents 7ca9bdd + 0f49eaf commit 144959b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/PIL/Jpeg2KImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,10 @@ def _parse_codestream(fp):
lsiz, rsiz, xsiz, ysiz, xosiz, yosiz, _, _, _, _, csiz = struct.unpack_from(
">HHIIIIIIIIH", siz
)
ssiz = [None] * csiz
xrsiz = [None] * csiz
yrsiz = [None] * csiz
for i in range(csiz):
ssiz[i], xrsiz[i], yrsiz[i] = struct.unpack_from(">BBB", siz, 38 + 3 * i)

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

0 comments on commit 144959b

Please sign in to comment.