mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Simplified code
This commit is contained in:
parent
1f182ce8da
commit
0f49eaf230
|
@ -106,14 +106,10 @@ def _parse_codestream(fp):
|
||||||
lsiz, rsiz, xsiz, ysiz, xosiz, yosiz, _, _, _, _, csiz = struct.unpack_from(
|
lsiz, rsiz, xsiz, ysiz, xosiz, yosiz, _, _, _, _, csiz = struct.unpack_from(
|
||||||
">HHIIIIIIIIH", siz
|
">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)
|
size = (xsiz - xosiz, ysiz - yosiz)
|
||||||
if csiz == 1:
|
if csiz == 1:
|
||||||
|
ssiz = struct.unpack_from(">B", siz, 38)
|
||||||
if (ssiz[0] & 0x7F) + 1 > 8:
|
if (ssiz[0] & 0x7F) + 1 > 8:
|
||||||
mode = "I;16"
|
mode = "I;16"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user