From 050cfb2e437b79460dc8ac82872b7727aceacc00 Mon Sep 17 00:00:00 2001 From: Juergen Weigert Date: Wed, 28 Oct 2020 23:38:36 +0100 Subject: [PATCH] https://github.com/ameisso found an issue (probably on MacOS?) The script keeps crashing when I export PNG from photoshop even if the finder gives me the right size. This is correcting the issue https://github.com/jnweiger/led-name-badge-ls32/pull/20 I am picking the one line important line, that should fix it. --- led-badge-11x44.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/led-badge-11x44.py b/led-badge-11x44.py index 4aaf062..ac66a8f 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -335,7 +335,7 @@ def bitmap_img(file): for bit in range(8): # [0..7] bit_val = 0 x = 8*col+bit - if x < im.width: + if x < im.width and row < im.height: pixel_color = im.getpixel( (x, row) ) if isinstance(pixel_color, tuple): monochrome_color = sum(pixel_color[:3]) / len(pixel_color[:3])