nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.84k stars 7.72k forks source link

stb_image can not parse this image #1298

Closed photopea closed 2 years ago

photopea commented 2 years ago

I am getting some weird output when trying to decode the following JPG image with your library. Could you please look at it?

https://user-images.githubusercontent.com/20317691/156213236-fbc8ba5b-b1ee-4412-88a1-bda9dedc27a3.JPG

nothings commented 2 years ago

Fixed for next version.

[Image contains a restart marker immediately after the end of the image data, which stb_image treated as a corrupt image (such markeers are only supposed to appear inside the image data, as they're used to recover after datastream corruption; I don't know if this technically violates the spec, but it's easy enough to handle regardless).]

FWIW we do not recommend use of stb_image in this kind of environment, as stb_image is more likely to have security issues than standard libraries like libjpeg/libpng.

photopea commented 2 years ago

That is great, thanks! I use only your JPG decoder.

When will you release the next version? Could you put it on GitHub already?

nothings commented 2 years ago

https://gist.github.com/nothings/4f15affa5aaa3afae1b9bcf972f07514

photopea commented 2 years ago

Thank you very much!