Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: image index out of range #5

Open
LordOfTheSnow opened this issue Dec 12, 2021 · 1 comment
Open

IndexError: image index out of range #5

LordOfTheSnow opened this issue Dec 12, 2021 · 1 comment

Comments

@LordOfTheSnow
Copy link

LordOfTheSnow commented Dec 12, 2021

Could you please provide a little more info how to use your example program?

After a lot of hassling around with the bluetooth connection (finally had to run your program with sudo privileges) I get this error message:

IndexError: image index out of range

This is the callstack:

sudo python3 pixoo.py 11:75:58:BB:BF:71 cropped-icon-16x16.png
Traceback (most recent call last):
  File "pixoo.py", line 320, in <module>
    pixoo.draw_pic(img_path)
  File "pixoo.py", line 231, in draw_pic
    nb_colors, palette, pixel_data = self.encode_image(filepath)
  File "pixoo.py", line 247, in encode_image
    return self.encode_raw_image(img)
  File "pixoo.py", line 265, in encode_raw_image
    pix = img.getpixel((x,y))
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1315, in getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

This is the image that I tried:

cropped-icon-16x16

@LordOfTheSnow
Copy link
Author

OK, I found out I had to change the class from PixooMax to Pixoo

pixoo = Pixoo(pixoo_baddr)

Now it works, even without sudo privileges.

Do you plan to implement some other basic functions such as displaying date and time or adding a scrolling text?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant