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

sdslideshow.py could skip progressive jpegs instead of throwing an exception #1

Open
jose1711 opened this issue Dec 15, 2022 · 5 comments

Comments

@jose1711
Copy link

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 into try.. except block together with autoincrementing the cursor.

@kevinjwalters
Copy link
Owner

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.

@jose1711
Copy link
Author

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.

kevinjwalters pushed a commit that referenced this issue Dec 17, 2022
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
@kevinjwalters
Copy link
Owner

kevinjwalters commented Dec 17, 2022

@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.

@jose1711
Copy link
Author

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.

@kevinjwalters
Copy link
Owner

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.

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

2 participants