Skip to content

Commit d4521d2

Browse files
committed
Fix loading one bit images with non /8 width
1 parent d3df39d commit d4521d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_imageload/bmp/indexed.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def load(file, width, height, data_start, colors, color_depth, *, bitmap=None, p
6262
bitmap = bitmap(width, height, colors)
6363
file.seek(data_start)
6464
line_size = width // (8 // color_depth)
65+
if width % (8 // color_depth) != 0:
66+
line_size += 1
6567
if line_size % 4 != 0:
6668
line_size += (4 - line_size % 4)
6769

0 commit comments

Comments
 (0)