Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion adafruit_displayio_layout/widgets/icon_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def __init__(self, label_text, icon, on_disk=False, **kwargs):
if on_disk:
self._file = open(self._icon, "rb")
image = OnDiskBitmap(self._file)
tile_grid = TileGrid(image, pixel_shader=ColorConverter())
tile_grid = TileGrid(
image, pixel_shader=getattr(image, "pixel_shader", ColorConverter())
)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding the following comment after the tile_grid = ... line

            # TODO: Once CP6 is no longer supported replace the above line with below.
            # tile_grid = TileGrid(image, pixel_shader=image.pixel_shader)

image, palette = adafruit_imageload.load(icon)
tile_grid = TileGrid(image, pixel_shader=palette)
Expand Down