Skip to content

move prev,line swap to after putting data into bitmap #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2025
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