image icon indicating copy to clipboard operation
image copied to clipboard

"no marker found where RST2 was expected" error on decoding a damaged-but-readable JPEG file

Open Shnatsel opened this issue 5 years ago • 4 comments

This happens in image from git, revision 092db1e21b3e8736711e2cbe1d9b5245613756c1

Expected

Image decodes successfully

Actual behaviour

thread 'main' panicked at 'called Result::unwrap() on an Err value: Decoding(DecodingError { format: Exact(Jpeg), underlying: Some(Format("no marker found where RST2 was expected")) })', src/main.rs:3:18

Reproduction steps

mountain lion 1

fn main() -> std::io::Result<()> {
    let path = std::env::args().skip(1).next().unwrap();
    let image = image::io::Reader::open(path)?.guess_format().decode().unwrap();
    Ok(())
}

Shnatsel avatar May 28 '20 22:05 Shnatsel

The image has some artifacts, the file is likely damaged but the C implementation tries to decode this anyway. Since it's an edge case it's probably low priority.

Shnatsel avatar May 31 '20 20:05 Shnatsel

yes, I have the same issue with different images.

stalkerg avatar Apr 02 '23 12:04 stalkerg

Same issue here, really unclear as to how to debug this. Any update @Shnatsel ?

Another example picture: failing_image

VinayValsaraj-at avatar Dec 04 '23 16:12 VinayValsaraj-at

zune-jpeg can handle such images instead of panicking, so #1877 will fix this. It is expected to ship in the next semver-breaking release.

Shnatsel avatar Dec 04 '23 22:12 Shnatsel