mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-29 11:26:17 +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":
|
||||
break
|
||||
elif ix == 2: # token is maxval
|
||||
if token > 255:
|
||||
maxval = token
|
||||
if maxval > 255:
|
||||
if not mode == "L":
|
||||
raise ValueError(f"Too many colors for band: {token}")
|
||||
if token < 2 ** 16:
|
||||
|
|
Loading…
Reference in New Issue
Block a user