jpeg-decoder icon indicating copy to clipboard operation
jpeg-decoder copied to clipboard

Failed to decode progressive JPEG

Open alu opened this issue 6 years ago • 5 comments

  • I encountered spectral selection is not allowed in non-progressive scan Error.
  • convert command in Linux displayed Invalid SOS parameters for sequential JPEG warning but the image was generated successfully.
  • The images are generated by these hardwere in my case
    • samsung SCV36
    • samsung SC-02G
    • samsung SC-05G

may be relevant

  • https://github.com/image-rs/image/issues/738
  • https://stackoverflow.com/questions/48653584/cannot-load-jpeg-with-java-created-by-samsung-phone

alu avatar Dec 10 '19 17:12 alu

Can you provide an image that triggers the error ? If possible, the image should not be copyrighted so that it can be redistributed freely with the test data for this repository.

lovasoa avatar Dec 10 '19 17:12 lovasoa

@lovasoa

Sorry, i can't do it because images that the problem occurs are owned by our customers. I looking for user of those hardware in my company but probably not present.

alu avatar Dec 10 '19 23:12 alu

I had the same issue with one specific image from my collection. This picture has been taken with a Samsung Galaxy J3 (SM-J320FN).

Version: jpeg-decoder = "0.1", compiled with Rust 1.36.0

Code:

fn main() {
    let file = File::open("/home/enz/Images/bug_imgrust.jpg").expect("failed to open file");
    let mut decoder = jpeg::Decoder::new(BufReader::new(file));
    let pixels = decoder.decode().expect("failed to decode image");
    let metadata = decoder.info().unwrap();
}

Error:

thread 'main' panicked at 'failed to decode image: Format("spectral selection is not allowed in non-progressive scan")', src/libcore/result.rs:999:5

For this particular image of my collection, the identify -verbose command complains with the following message:

identify-im6.q16: Invalid SOS parameters for sequential JPEG `/home/enz/Images/bug_imgrust.jpg' @ warning/jpeg.c/JPEGWarningHandler/352.

I don't know if that SOS stuff can have a relationship with the present problem. Maybe it's just a coincidence, but just in case, it can be worth mentioning.

I can send you the picture by email (I appear in this photo).

enzzc avatar Dec 30 '19 02:12 enzzc

Finally I find image which cause this error - 20190821_154545.jpg.zip

qarmin avatar Jan 12 '21 18:01 qarmin

+1 -- we're seeing this in our app, too.

biot023 avatar Mar 16 '21 15:03 biot023