image-rs / jpeg-decoder

JPEG decoder written in Rust
Apache License 2.0
149 stars 87 forks source link

Allow decoding with bad spectral selection end #190

Closed vstroebel closed 2 years ago

vstroebel commented 3 years ago

In non progressive mode the spectral selection end must be 63 but some encoder set all progressive mode related information to 0.

This is a possible fix for #130 but it doesn't allow to decode the image provided by @qarmin in https://github.com/image-rs/jpeg-decoder/issues/130#issuecomment-758847217 because this image seems to miss an expected restart marker which might not be related to this issue.

The updated version allows to decode the example file.