Skip to content

Commit 0d9d5b8

Browse files
author
Matt Land
committed
working commit before merge
1 parent 0ca9b1c commit 0d9d5b8

6 files changed

Lines changed: 9 additions & 8 deletions

File tree

adafruit_imageload/pnm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def load(file, header, *, bitmap=None, palette=None):
4848
bitmap = bitmap(pnm_header[0], pnm_header[1], 1)
4949
if palette:
5050
palette = palette(1)
51-
palette[0] = 0xFFFFFF
51+
palette[0] = 0xFF
5252
if magic_number.startswith(b"P1"):
5353
from . import pbm_ascii
5454

adafruit_imageload/tests/shared_binding_interface.py

Whitespace-only changes.

adafruit_imageload/tests/test_pnm_load.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_load_works_p1_ascii(self):
154154
"..",
155155
"examples",
156156
"images",
157-
"netpbm_p1_mono.pbm",
157+
"netpbm_p1_mono_ascii.pbm",
158158
)
159159
with open(test_file, "rb") as f:
160160
bitmap, palette = pnm.load(f, b"P1", bitmap=Bitmap_C_Interface)
@@ -182,7 +182,7 @@ def test_load_works_p4_binary(self):
182182
"..",
183183
"examples",
184184
"images",
185-
"netpbm_p4_mono.pbm",
185+
"netpbm_p4_mono_binary.pbm",
186186
)
187187
with open(test_file, "rb") as f:
188188
bitmap, palette = pnm.load(f, b"P4", bitmap=Bitmap_C_Interface)
@@ -205,8 +205,8 @@ def test_load_works_p4_binary_high_res(self):
205205
bitmap, palette = pnm.load(f, b"P4", bitmap=Bitmap_C_Interface)
206206
self.assertTrue(isinstance(bitmap, Bitmap_C_Interface))
207207
self.assertEqual(1, bitmap.colors)
208-
self.assertEqual(1920, bitmap.width)
209-
self.assertEqual(1080, bitmap.height)
208+
self.assertEqual(320, bitmap.width)
209+
self.assertEqual(240, bitmap.height)
210210

211211

212212
class TestPPMLoad(TestCase):

docs/pbm_test_code.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Testing script for PBM
2+
This is a hardware testing script for PBM
33
Tested with Feather M4 Express and 2.4" Featherwing
44
1. Flash board to 4x
55
2. add 'adafruit_ili9341.mpy' for 4x firmware to /lib/ on board
@@ -26,10 +26,11 @@
2626
# Make the display context
2727
splash = displayio.Group(max_size=10)
2828
display.show(splash)
29-
29+
#image = "images/netpbm_p1_mono_ascii.pbm"
30+
image = "images/netpbm_p4_mono_binary.pbm"
3031

3132
bitmap, palette = adafruit_imageload.load(
32-
"images/netpbm_p1_mono.pbm", bitmap=displayio.Bitmap, palette=displayio.Palette
33+
image, bitmap=displayio.Bitmap, palette=displayio.Palette
3334
)
3435

3536

0 commit comments

Comments
 (0)