Skip to content

Commit b18dfb7

Browse files
author
bstorm
committed
Not supporting 16 bit until we sort that out
1 parent ce7646e commit b18dfb7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adafruit_imageload/pnm/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ def load(f, header, *, bitmap=None, palette=None):
4343
while True:
4444
# We have all we need at length 3
4545
if len(pnm_header) == 3:
46+
test_byte = f.read(1)
47+
if test_byte.isdigit():
48+
raise RuntimeError("Not supporting 16-bit colors at this time")
4649
break
4750
if magic_number.startswith(b"P1") or magic_number.startswith(b"P4"):
4851
if len(pnm_header) == 2:
52+
f.read(1)
4953
from . import pbm
5054

5155
return pbm.load(

0 commit comments

Comments
 (0)