Page 1 of 1
Jpeg decoder failed
Posted: Thu Nov 12, 2015 9:59 am
by rrTea
I'm trying to import some images in jpg format by directly drag and dropping them into the IDE, but it just turns out blank and a "Jpeg decoder failed." message pops up in the console. Pngs work as expected (no error and ZGE automatically generates all the components in the Project Tree).
Not a big deal for me since I never use jpgs at all but since I bumpred into it I thought I might as well report it.
Edit: actually I can't import jpgs even if I manually create all the components and try to import the image from the BitmapFromFile / Import... (here, too, pngs work no problem).
Re: Jpeg decoder failed
Posted: Thu Nov 12, 2015 11:44 am
by Kjell
Hi rrTea,
Only Baseline ("Standard") and Baseline Optimized JPGs are supported, Progressive Scan* JPGs are not. So, make sure your JPGs use a supported format.
*Progressive Scan used to be particularly useful for the web back in the 14.4k days, as you could see the image going from super pixelated to the final image ( see demo below ) while it's being (down)loaded. But that's not really relevant for ZGE, hence it not being supported.
K
Re: Jpeg decoder failed
Posted: Fri Nov 13, 2015 12:45 am
by rrTea
Oh indeed, that's the case - it just so happened that all the jpgs I tried were saved in the unsupported format.
Maybe the error message should be more specific (or link to this thread).
Re: Jpeg decoder failed
Posted: Sun May 22, 2016 9:18 am
by rrTea
I tried working with jpgs again and I checked whether the images are saved using Progressive Scan - and no, they aren't but still fail to work properly when re-imported into an existing Bitmap / BitmapFromFile (of identical dimensions).
![Sometimes the top is garbled, sometimes the whole image etc](./download/file.php?id=1979&sid=08d9c5cf8c56381f1a4ecaba0c78a014)
- Sometimes the top is garbled, sometimes the whole image etc
- 剪贴板图片 (19).png (151.25 KiB) Viewed 13901 times
Confusingly, drag and dropping the same jpg into the Project Tree works. Surely if the image is in an unsupported format both methods would fail (or the other way around, if the image is acceptable it should work in both cases)? And the same image works perfectly in a fresh project regardless of the method used.
Just to make sure I tried to save the jpgs with all possible permutations of options that Photoshop offers when saving a jpg (including going through Save for Web) - none of the resulting files can be imported into an existing bitmap. Trying to convert a png to jpg using other tools other than Photoshop also gives the same garbled result once reimported.
In the end I deleted the old BitmapFromFile, made a new one, imported the image and voila' it works.