Skip to content

Commit 9637b47

Browse files
committed
finally, remove workaround code
1 parent f931aee commit 9637b47

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

adafruit_imageload/png.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,10 @@ def load( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
109109
mem = memoryview(bmp)
110110
for y in range(height):
111111
# Adjust for Displayio.Bitmap filler to scanline at 4-byte boundry
112-
filladj = y * ((4 - (width % 4)) % 4)
112+
filladj = y * ((4 - (scanline % 4)) % 4)
113113
dst = y * scanline + filladj
114114
src = y * (scanline + 1) + 1
115-
if depth < 8:
116-
# Work around the bugs in displayio.Bitmap
117-
# The first should have been resolved by #9479
118-
# https://github.com/adafruit/circuitpython/issues/6675
119-
# https://github.com/adafruit/circuitpython/issues/9707
120-
pixels_per_byte = 8 // depth
121-
for x in range(0, width, pixels_per_byte):
122-
byte = data_bytes[src]
123-
for pixel in range(pixels_per_byte):
124-
bmp[x + pixel, y] = (byte >> ((pixels_per_byte - pixel - 1) * depth)) & (
125-
(1 << depth) - 1
126-
)
127-
src += 1
128-
else:
129-
mem[dst : dst + scanline] = data_bytes[src : src + scanline]
115+
mem[dst : dst + scanline] = data_bytes[src : src + scanline]
130116
return bmp, pal
131117
# RGB, RGBA or Grayscale
132118
import displayio

0 commit comments

Comments
 (0)