Closed eloj closed 9 years ago
I can confirm that this happens on some JPEGs, not necessarily progressive.
ybb, can you send me such a non-progressive JPEG or a link to one? It might be the same thing or it might be something different, so I need a sample image.
Err, sorry. I was too impatient to double-check. They are progressive. Here are some if you need more to test.
These say "bad huffman code": http://40.media.tumblr.com/424f289d7f2e2a02636b264693a2d159/tumblr_n9rgjzeeXY1r493ruo2_r1_500.jpg http://41.media.tumblr.com/319546120a728c619dc6e93164040f7d/tumblr_ndg8ez34Ww1qz7ywso1_500.jpg
These say "junk before marker": http://36.media.tumblr.com/80724ad0d70f6345f0d7b40e69804558/tumblr_ndjttanVnB1qz7ywso1_1280.jpg http://41.media.tumblr.com/1ce735e8c44894d245305b63f50633c8/tumblr_ndk2jm09Fi1qz7ywso1_1280.jpg
Thanks.
I'm about to do a new release, so I put some work into this, but I couldn't figure it out. I'm going to have to run these files through another jpeg decoder and see where I deviate, but getting another jpeg decoder set up will be a pain... maybe for next release.
Should be fixed in version 2.05
I have come across a progressive jpeg that loads in GD, OS X Preview and checks out okay with jpeginfo, but returns "bad huffman code" from stbi_load.
The image in question can be downloaded from https://unsplash.com/photos/8bMPkZgazyY/download, but you'll probably have to go there with a browser and save-as as using curl straight on the URL gives a lower resolution one.
It entirely possible that the image is indeed corrupt, but I thought I'd offer you the chance to look at it if you want. If it's an unsupported format I feel like the error message should be made clearer, if possible.
EDIT: Testing more images this seems very common, so not quite the white unicorn I thought I'd found.