From 3c8e969e56f017de4a22edbeab23063d500064e6 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Sat, 17 Jan 2026 14:34:00 +0000 Subject: [PATCH] Remove ImageDecoderRect implementation from `image` integration Upstream `image` will remove this trait in the next major release due to lack of both implementors and users: https://github.com/image-rs/image/pull/2681 I'm opening this PR now, ahead of the next `image` release, so that I could depend on `image` from git in my project and still be able to decode JPEG XL files. --- crates/jxl-oxide/src/integration/image.rs | 27 ----------------------- 1 file changed, 27 deletions(-) diff --git a/crates/jxl-oxide/src/integration/image.rs b/crates/jxl-oxide/src/integration/image.rs index a09273e6..821f1def 100644 --- a/crates/jxl-oxide/src/integration/image.rs +++ b/crates/jxl-oxide/src/integration/image.rs @@ -386,33 +386,6 @@ impl image::ImageDecoder for JxlDecoder { } } -impl image::ImageDecoderRect for JxlDecoder { - fn read_rect( - &mut self, - x: u32, - y: u32, - width: u32, - height: u32, - buf: &mut [u8], - row_pitch: usize, - ) -> ImageResult<()> { - let crop = CropInfo { - width, - height, - left: x, - top: y, - }; - - self.read_image_inner(crop, buf, Some(row_pitch)) - .map_err(|e| { - ImageError::Decoding(DecodingError::new( - ImageFormatHint::PathExtension("jxl".into()), - e, - )) - }) - } -} - fn stream_to_buf( mut stream: crate::ImageStream<'_>, buf: &mut [u8],