Skip to content
Merged
Changes from all 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_imageload/png.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
src += 1
else:
raise ValueError("Wrong filter.")
prev, line = line, prev
if mode in (0, 4): # grayscale
for x in range(width):
c = line[x * unit]
Expand All @@ -180,5 +179,8 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
)
else:
raise ValueError("Unsupported color mode.")

prev, line = line, prev

pal = displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565)
return bmp, pal
Loading