mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-01 04:46:18 +03:00
Create maxval
variable
This commit is contained in:
parent
50522d932e
commit
39288f0fb0
|
@ -125,7 +125,8 @@ class PpmImageFile(ImageFile.ImageFile):
|
||||||
if mode == "1":
|
if mode == "1":
|
||||||
break
|
break
|
||||||
elif ix == 2: # token is maxval
|
elif ix == 2: # token is maxval
|
||||||
if token > 255:
|
maxval = token
|
||||||
|
if maxval > 255:
|
||||||
if not mode == "L":
|
if not mode == "L":
|
||||||
raise ValueError(f"Too many colors for band: {token}")
|
raise ValueError(f"Too many colors for band: {token}")
|
||||||
if token < 2 ** 16:
|
if token < 2 ** 16:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user