Skip to content

Commit 82c0841

Browse files
committed
workaound left in as comments for documentation
1 parent 9637b47 commit 82c0841

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

adafruit_imageload/png.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
112112
filladj = y * ((4 - (scanline % 4)) % 4)
113113
dst = y * scanline + filladj
114114
src = y * (scanline + 1) + 1
115+
# Work around the bug in displayio.Bitmap - removed afer resolution
116+
# however left here as comments because it's helpful in
117+
# understanding the memoryview scanline and adjustment calculations
118+
# https://github.com/adafruit/circuitpython/issues/6675
119+
# https://github.com/adafruit/circuitpython/issues/9707
120+
#
121+
# pixels_per_byte = 8 // depth
122+
# for x in range(0, width, pixels_per_byte):
123+
# byte = data_bytes[src]
124+
# for pixel in range(pixels_per_byte):
125+
# bmp[x + pixel, y] = (byte >> ((pixels_per_byte - pixel - 1) * depth)) & (
126+
# (1 << depth) - 1
127+
# )
128+
# src += 1
129+
#
115130
mem[dst : dst + scanline] = data_bytes[src : src + scanline]
116131
return bmp, pal
117132
# RGB, RGBA or Grayscale

0 commit comments

Comments
 (0)