Skip to content

Commit 13153a8

Browse files
author
Matt Land
committed
patch
1 parent dd0f846 commit 13153a8

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ _build
44
.env
55
build*
66
bundles
7+
.idea/
8+
venv/
9+

adafruit_imageload/pnm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def load(f, header, *, bitmap=None, palette=None):
6363
if next_byte == b"\n":
6464
break
6565
if next_byte.isdigit():
66-
pnm_header.append(int.from_bytes(next_byte, "big"))
66+
pnm_header.append(int(next_byte))
6767
continue
6868

6969
if not next_byte:

examples/images/netpbm_p1_mono.pbm

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
P1
2+
# This is an example bitmap of the letter "J" in a 2x2 grid
3+
13 21
4+
0 0 0 0 0 0 0 0 0 0 0 0 0
5+
0 0 0 0 0 1 0 0 0 0 0 1 0
6+
0 0 0 0 0 1 0 0 0 0 0 1 0
7+
0 0 0 0 0 1 0 0 0 0 0 1 0
8+
0 0 0 0 0 1 0 0 0 0 0 1 0
9+
0 0 0 0 0 1 0 0 0 0 0 1 0
10+
0 0 0 0 0 1 0 0 0 0 0 1 0
11+
0 1 0 0 0 1 0 1 0 0 0 1 0
12+
0 0 1 1 1 0 0 0 1 1 1 0 0
13+
0 0 0 0 0 0 0 0 0 0 0 0 0
14+
0 0 0 0 0 0 0 0 0 0 0 0 0
15+
0 0 0 0 0 1 0 0 0 0 0 1 0
16+
0 0 0 0 0 1 0 0 0 0 0 1 0
17+
0 0 0 0 0 1 0 0 0 0 0 1 0
18+
0 0 0 0 0 1 0 0 0 0 0 1 0
19+
0 0 0 0 0 1 0 0 0 0 0 1 0
20+
0 0 0 0 0 1 0 0 0 0 0 1 0
21+
0 1 0 0 0 1 0 1 0 0 0 1 0
22+
0 0 1 1 1 0 0 0 1 1 1 0 0
23+
0 0 0 0 0 0 0 0 0 0 0 0 0
24+
0 0 0 0 0 0 0 0 0 0 0 0 0

examples/images/netpbm_p4_mono.pbm

76 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)