Skip to content

Commit 42db804

Browse files
authored
Merge pull request #15 from tannewt/fix_one_bit
Fix loading one bit images with non /8 width
2 parents d3df39d + 2e4c12c commit 42db804

File tree

2 files changed

+2
-0
lines changed

2 files 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

1.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)