mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-01 03:33:21 +03:00
Read support for 16 bit pgm file
This commit is contained in:
parent
864fb95cb1
commit
f5ba642b5e
|
@ -96,7 +96,18 @@ class PpmImageFile(ImageFile.ImageFile):
|
||||||
ysize = s
|
ysize = s
|
||||||
if mode == "1":
|
if mode == "1":
|
||||||
break
|
break
|
||||||
|
elif ix == 2:
|
||||||
|
# maxgrey
|
||||||
|
if s > 255:
|
||||||
|
if not mode == 'L':
|
||||||
|
raise ValueError("Too many colors for band: %s" %s)
|
||||||
|
if s <= 2**16 - 1:
|
||||||
|
self.mode = 'I'
|
||||||
|
rawmode = 'I;16B'
|
||||||
|
else:
|
||||||
|
self.mode = 'I';
|
||||||
|
rawmode = 'I;32B'
|
||||||
|
|
||||||
self.size = xsize, ysize
|
self.size = xsize, ysize
|
||||||
self.tile = [("raw",
|
self.tile = [("raw",
|
||||||
(0, 0, xsize, ysize),
|
(0, 0, xsize, ysize),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user