Trouble loading and drawing images from internet

Hi oF forum.

I am currently developing an app that runs on the raspberry pi. It regularly (every 30 seconds) downloads an image from the internet and displays it on the screen. Very occasionally (once every few hours) I am getting a strange bug where the image I am downloading looks as if it’s been downloaded half-way from the top left corner. The top (approximate) half of the image is all loaded but the bottom half of the image is all grey. It looks as if the image has just stopped being drawn around the middle!

I’m using two ofFbo object, one to display the current image and one to load the next image and do some image processing and then I’m getting and ofTexture out of it to draw.

I have never seen this bug before and it seems to happen randomly and is quite hard to reproduce so I’m unsure exactly what is causing it.

Anyone experience something like this? I’d be happy to post some sample-code from my project if anyone thinks that would be helpful.

Thanks!

James Bentley

It sounds like the image wasn’t fully downloaded. Like back in the day of dial-up internet i remember this being a problem. Do you have any checks in place to make sure the image was fully downloaded or that there wasn’t a timeout. Try to put some debug information whenever you are handling the image and the downloading of the image so that if there is an error it would be easier to identify/isolate.

Hey Dom thanks for the reply.

I suspect this is exactly what’s happening as the image is being downloaded via wifi in locations with notoriously slow internet.

I’m perfectly happy just waiting until the next image is loaded even if it takes forever so long as the image is fully loaded when it’s displayed