Skip to content

Commit b008a72

Browse files
author
Matt Land
committed
Add pbm
1 parent dc6e3ae commit b008a72

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

adafruit_imageload/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ def load(filename, *, bitmap=None, palette=None):
5555
return pnm.load(f, header, bitmap=bitmap, palette=palette)
5656
else:
5757
raise RuntimeError("Unsupported image format")
58-
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import logging
2+
3+
4+
5+
def load(f, magic_number, header, bitmap = None , palette = None):
6+
# type: (stream, str, list, c_obj, c_obj) -> bitmap, palette
7+
height = header[0]
8+
width = header[1]
9+
logging.info(f'height: {height}')
10+
if palette:
11+
palette = palette(1)
12+
if bitmap:
13+
bitmap = bitmap(header[0], header[1], 1)
14+
for line in range(height-1,-1,-1):
15+
16+
chunk = f.read(width)
17+
#logging.info(chunk)
18+
return bitmap, palette
19+
20+
#while not has 3 signnif

0 commit comments

Comments
 (0)