Skip to content

Commit c36419b

Browse files
authored
Merge pull request #92 from FoamyGuy/move_prev_line_swap
move prev,line swap to after putting data into bitmap
2 parents 295e799 + 519d5f7 commit c36419b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_imageload/png.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
168168
src += 1
169169
else:
170170
raise ValueError("Wrong filter.")
171-
prev, line = line, prev
172171
if mode in (0, 4): # grayscale
173172
for x in range(width):
174173
c = line[x * unit]
@@ -180,5 +179,8 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
180179
)
181180
else:
182181
raise ValueError("Unsupported color mode.")
182+
183+
prev, line = line, prev
184+
183185
pal = displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565)
184186
return bmp, pal

0 commit comments

Comments
 (0)