Repository: image-rs/image (language: rust)

Issue:
Fails to decode jpeg headers for image with width or height > 16384 px
This happens in the latest public release of this crate on this date, i.e. 0.25

## Expected

Should be able to decode the image incase the `Limit` is turned off (using `reader.no_limits()`) or set to > 16384 (custom `Limit` with `max_image_width` and `max_image_height` set to the desired amount, 26560 in my case)

## Actual behaviour
Fails with error message from `zune_jpeg` crate: 
```Error: Decoding(DecodingError { format: Exact(Jpeg), underlying: Some("Image width 26560 greater than width limit 16384. If use `set_limits` if you want to support huge images") })```

## Reproduction steps

Provide source code, a repository link, or steps
```rust
use std::io::BufReader;
use std::fs::File;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut reader = image::io::Reader::new(BufReader::new(File::open("./canvas.jpg")?));  // image with res 26560x26560
    // let mut limits = image::io::Limits::default();
    // limits.max_image_width = Some(30000);
    // limits.max_image_height = Some(30000);
    // reader.limits(limits);
    reader.no_limits();
    reader = reader.with_guessed_format()?;
    let _img = reader.decode()?;
    Ok(())
}
```

Generated `canvas.jpg` for testing using `Imagemagick` with command below:
`convert -size 26560x26560 xc:white canvas.jpg `


Discussion / hints:

Fix patch:
diff --git a/src/codecs/jpeg/decoder.rs b/src/codecs/jpeg/decoder.rs
index 2fc51c1780..895b471e91 100644
--- a/src/codecs/jpeg/decoder.rs
+++ b/src/codecs/jpeg/decoder.rs
@@ -28,7 +28,10 @@ impl<R: BufRead + Seek> JpegDecoder<R> {
         let mut input = Vec::new();
         let mut r = r;
         r.read_to_end(&mut input)?;
-        let mut decoder = zune_jpeg::JpegDecoder::new(input.as_slice());
+        let options = zune_core::options::DecoderOptions::default()
+            .set_max_width(usize::MAX)
+            .set_max_height(usize::MAX);
+        let mut decoder = zune_jpeg::JpegDecoder::new_with_options(input.as_slice(), options);
         decoder.decode_headers().map_err(ImageError::from_jpeg)?;
         // now that we've decoded the headers we can `.unwrap()`
         // all these functions that only fail if called before decoding the headers


Test patch: