Skip to content

Commit

Permalink
Fix parsing the J2K header
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Mar 25, 2024
1 parent 901c13c commit 1f182ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PIL/Jpeg2KImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def _parse_codestream(fp):
xrsiz = [None] * csiz
yrsiz = [None] * csiz
for i in range(csiz):
ssiz[i], xrsiz[i], yrsiz[i] = struct.unpack_from(">BBB", siz, 36 + 3 * i)
ssiz[i], xrsiz[i], yrsiz[i] = struct.unpack_from(">BBB", siz, 38 + 3 * i)

size = (xsiz - xosiz, ysiz - yosiz)
if csiz == 1:
if (yrsiz[0] & 0x7F) + 1 > 8:
if (ssiz[0] & 0x7F) + 1 > 8:
mode = "I;16"
else:
mode = "L"
Expand Down

0 comments on commit 1f182ce

Please sign in to comment.