mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Fix parsing the J2K header
This commit is contained in:
parent
901c13c4b1
commit
1f182ce8da
|
@ -110,11 +110,11 @@ def _parse_codestream(fp):
|
||||||
xrsiz = [None] * csiz
|
xrsiz = [None] * csiz
|
||||||
yrsiz = [None] * csiz
|
yrsiz = [None] * csiz
|
||||||
for i in range(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)
|
size = (xsiz - xosiz, ysiz - yosiz)
|
||||||
if csiz == 1:
|
if csiz == 1:
|
||||||
if (yrsiz[0] & 0x7F) + 1 > 8:
|
if (ssiz[0] & 0x7F) + 1 > 8:
|
||||||
mode = "I;16"
|
mode = "I;16"
|
||||||
else:
|
else:
|
||||||
mode = "L"
|
mode = "L"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user