I'm developing an application which downloads JPEG pictures via sockets that come from an Internet camera. I'm testing it on Nokia N95 8GB (S60v3) and Samsung i8910 (S60v5).
I'm having troubles with loading big part of JPEG them. Some of them load fine and some of them give Exception (bad image format) on line:
lastImage = Image.createImage(buffer.buf[slot], 0, buffer.len[slot]);
where buffer.buf[slot] is a byte array and buffer.len[slot] is length of the JPEG data in this array (buffers are bigger than images).
The exceptions are not thrown and all JPEG files load ok on the Sun's WTK emulator. I checked the data that are received by the phone by saving them to files with FileConnection API and the erroneous ones are displayed fine e.g. by the Resco Photo Viewer on the phone or by any PC app on Windows, but are not displayed by the S60 gallery.
Here are links to example good and bad image:
I suppose it's some bug in Symbian JPEG loading lib, but is there any work-around for this? Did anybody experience such issue? Can it be fixed by e.g. changing some bytes in the header? Are there any JPEG gurus here that know exactly what bytes in this JPEG file are not tolerated by the phone?