From 8d285be2260a24c7fdf2c2da50cd665c7342e1eb Mon Sep 17 00:00:00 2001 From: Inflation <2375962+inflation@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:38:48 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20Remove=20unused=20color=20?= =?UTF-8?q?encoding=20setup=20when=20encoding=20JPEG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jpegxl-rs/src/encode.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jpegxl-rs/src/encode.rs b/jpegxl-rs/src/encode.rs index d773f48..84f8919 100644 --- a/jpegxl-rs/src/encode.rs +++ b/jpegxl-rs/src/encode.rs @@ -486,9 +486,6 @@ impl<'prl, 'mm> JxlEncoder<'prl, 'mm> { /// # Errors /// Return [`EncodeError`] if the internal encoder fails to encode pub fn encode_jpeg(&mut self, data: &[u8]) -> Result, EncodeError> { - // If using container format, store JPEG reconstruction metadata - self.check_enc_status(unsafe { JxlEncoderStoreJPEGMetadata(self.enc, true) })?; - if let Some(runner) = self.parallel_runner { unsafe { self.check_enc_status(JxlEncoderSetParallelRunner( @@ -501,7 +498,8 @@ impl<'prl, 'mm> JxlEncoder<'prl, 'mm> { self.set_options()?; - unsafe { JxlEncoderSetColorEncoding(self.enc, &self.color_encoding.into()) }; + // If using container format, store JPEG reconstruction metadata + self.check_enc_status(unsafe { JxlEncoderStoreJPEGMetadata(self.enc, true) })?; self.add_jpeg_frame(data)?; self.start_encoding()