Jpeg decoder failed

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Jpeg decoder failed

Post 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).
User avatar
Kjell
Posts: 1910
Joined: Sat Feb 23, 2008 11:15 pm

Re: Jpeg decoder failed

Post 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.

Image

K
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: Jpeg decoder failed

Post 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).
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: Jpeg decoder failed

Post 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
Sometimes the top is garbled, sometimes the whole image etc
剪贴板图片 (19).png (151.25 KiB) Viewed 15502 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.
Post Reply