-
Notifications
You must be signed in to change notification settings - Fork 1
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
sdslideshow.py could skip progressive jpegs instead of throwing an exception #1
Comments
Yes, that's a good point, I imagine it's easy for a progressive one to sneak in and spoil the sequence. I should have some time this weekend to have a look. |
Thank you. That is true - speaking from a personal experience. And if you're running from AA batteries then being in an awake state is not the best idea either. |
Code now looks for RuntimeError exception which occurs for JPEGS with progressive encoding and will skip past them in forward or reverse direction. Button A from first image will not wrap around to the last image. Other exceptions that cause the main loop to terminate now power off the Inky Frame on battery power. #1
@jose1711 I've changed the code to skip past JPEGs that don't decode properly and to go into deep sleep if another exception happens to be thrown. Give it a go and let me know how it goes. |
Thank you, the code looks ok. I will test in the real life and report back in a few days. I am also thinking.. maybe an error condition could be indicated by an empty directory created on the card with the name of the problematic jpeg image in it? That way a user could work out candidates for fixing easily. |
It prints to serial console now but that's only useful if it's attached to a computer. A single error log file or an error file per image as you suggest could be more useful, latter could be less write intensive. I'm also pondering a status screen on button D. |
At this point whenever
jpeg.decode()
encounters a JPEG file with progressive encoding it throws an exception (and hence the whole slideshow stops). Ideally this is wrapped intotry.. except
block together with autoincrementing the cursor.The text was updated successfully, but these errors were encountered: