Skip to content

Commit e0808b0

Browse files
author
bstorm
committed
Merge remote-tracking branch 'origin/master' into ppm
2 parents 541084f + b18dfb7 commit e0808b0

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)