jnweiger / led-name-badge-ls32

Upload tool for an led name tag with USB-HID interface
GNU General Public License v2.0
230 stars 86 forks source link

IndexError: image index out of range #18

Closed kitazaki closed 5 years ago

kitazaki commented 5 years ago

im.getpixel( (x, row) fails when col is not a multiple of 8 and x exceeds col size of image.

[OK] $ python3 led-badge-11x44.py gfx/fablab_logo_16x11.png using [LSicroelectronics LS32 Custm HID] int=-1 page=1 via pyHIDAPI fetching bitmap from file gfx/fablab_logo_16x11.png -> (16 x 11) Type: 11x44

[NG] $ python3 led-badge-11x44.py gfx/fablab_logo_11x11.png using [LSicroelectronics LS32 Custm HID] int=-1 page=1 via pyHIDAPI fetching bitmap from file gfx/fablab_logo_11x11.png -> (11 x 11) Traceback (most recent call last): File "led-badge-11x44.py", line 469, in msgs.append(bitmap(arg)) File "led-badge-11x44.py", line 351, in bitmap return bitmap_img(arg) File "led-badge-11x44.py", line 331, in bitmap_img pixel_color = im.getpixel( (x, row) ) File "/usr/local/lib/python3.6/site-packages/PIL/Image.py", line 1377, in getpixel return self.im.getpixel(xy) IndexError: image index out of range