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 JpegDecoder { 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