FreeImage load hangs on damaged picture

BlitzMax Forums/Brucey's Modules/FreeImage load hangs on damaged picture

ima747(Posted 2010) [#1]
I have a jpeg that appears to have some damage. When loading it in FreeImage it hangs. One of my testers reported that if he waits long enough (like 30 minutes) it will eventually load, but I haven't had the time to let it sit and find out for myself.

My loading is done in a child thread, so I could watch that thread to see if it's been running for too long but I don't know how to kill it off if it has. It would obviously also be better if FreeImage could deal with the problem internally either with a timeout or detecting the bad data and either giving up or returning what it has so far. Any suggestions of what to do, or where to look in freeimage (it's a bit daunting for me to try to dig through it all without more free time) would be much appreciated.

I sent the damaged image to Brucy but I think my email has been bad about attachments recently so I don't know if it went through. I'm happy to send it on to whoever would be interested.


AdamRedwoods(Posted 2010) [#2]
I think I had problems with some JPGs that had unusual metatags in them.

I suggest upgrading to the newest FreeImage version (3.13). It was fairly easy to mod to get it to work, I had to add some "#ifndef __MINGW32__ " "#endif" around some things that weren't compiling correctly in "Freeimage.h".

I have the files if anyone wants to host it. I'd be happy to share.


ima747(Posted 2010) [#3]
please toss them my way, I'll give them a home until brucy updates the core.
email them to blitzmods (at) toscaledesign (dot) com if you would be so kind, I'll post a link once I've got them on my server.


Brucey(Posted 2010) [#4]
The current version in SVN is 3.13

The latest version of FreeImage is 3.13.1


ima747(Posted 2010) [#5]
re-downloaded current version from SVN off google code (hope that's the right place) to make sure I was up to date (I think I was) and same problem.


ima747(Posted 2010) [#6]
Update: newest newest SVN works nicely and handles errors much much better. Brucey also pointed me at the new SetFreeImageErrorHandler callback setter. Haven't played with it yet, but it should go a long way towards making my programs more idiot proof.