Skip to content

Commit fda9020

Browse files
authored
Merge pull request #41 from FoamyGuy/fix_odb
fix OnDiskBitmap pixel_shader
2 parents 8aa880d + 460e5fc commit fda9020

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adafruit_displayio_layout/widgets/icon_widget.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ def __init__(self, label_text, icon, on_disk=False, **kwargs):
5959
if on_disk:
6060
self._file = open(self._icon, "rb")
6161
image = OnDiskBitmap(self._file)
62-
tile_grid = TileGrid(image, pixel_shader=ColorConverter())
62+
tile_grid = TileGrid(
63+
image,
64+
pixel_shader=getattr(image, "pixel_shader", ColorConverter())
65+
# TODO: Once CP6 is no longer supported replace the above line with below.
66+
# tile_grid = TileGrid(image, pixel_shader=image.pixel_shader)
67+
)
6368
else:
6469
image, palette = adafruit_imageload.load(icon)
6570
tile_grid = TileGrid(image, pixel_shader=palette)

0 commit comments

Comments
 (0)