Skip to content

Commit

Permalink
move prev,line swap to after putting data into bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed Jan 14, 2025
1 parent 295e799 commit 519d5f7
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 519d5f7

Please sign in to comment.