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
occasional OverflowError with SetImage from Python #277
Comments
What happens if you print the size of the picture ? As long as you make sure that setting the image only happens in one thread and never concurrently with multiple threads, you should be fine. Also paging @chmullig , who provided the fast image implementation, to have a look (I only have limited Python experience). |
What is (I suspect so, because otherwise |
Yes, that is initialized within the Printing the size seems right: You know what, this is probably my fault. I was trying to disable the frame refreshing during a solid image and may have been calling Yeah, and I confirmed this by forgetting to clear again. Same error. So I guess this is solved as invalid. This library is so sweet though. I'm still super excited even though I did a false bug report. Have a good one! |
Hmmm, it may not be so simple. I'm still somewhat randomly seeming to be getting this error. Maybe I have to clear both of the double buffers? |
Sorry to hear its crashing, I'll take a look, but it might be a bit before I can really dive in. Can you confirm which version of PIL/Pillow you have installed? Looks like python 2.7? I assume you didn't rerun the cython build, right? For now there's an optional argument to disable the fast set image, so you should be able to get the old slow/safe behavior that way. |
If it is an intermittent problem it very much sounds like a threading issue. Did you make absolutely sure that you only access operations on a particular canvas ( It sounds like you have some independently running scenes, so if you run these in multiple threads sharing one canvas variable (because it looks like you have them in the 'disp' struct which seems to be shared between Scenes?), you're in trouble. However, if each scene owns their own canvas (separately created with |
I've tried to replicate this in Raspbian on a Raspberry Pi 3, including doing some work in other threads (fetching data, generating other images with PIL, etc). I wasn't able to replicate. Could you post more details on your setup, and if possible source code to replicate? |
It seems to have settled down with my code. I have not had a crash since my previous comment. I must have been doing something wrong. Sorry for the trouble. Full code is now at https://github.com/partofthething/infopanel in case you want to see exactly what I was doing. |
Hi. I'm having an amazing time with this library and have really brought my screen to life (really, I have pet Giraffes on it now). Anyway, I was adding a new scene to my library of scenes from Python that is intended to just show a static image. It's in an animation loop (I may have it move later) so it's all contained in a double-buffered loop like some demos. The relevant code is roughly:
Now, half the time, this works and the image shows nicely. But the other half, the whole thing crashes and I get this traceback:
Not sure if it matters, but this is a multithreaded application with an MQTT server to pull down live info for display from a server.
The text was updated successfully, but these errors were encountered: