Skip to content

Commit

Permalink
⚰️ Remove unused color encoding setup when encoding JPEG
Browse files Browse the repository at this point in the history
  • Loading branch information
inflation committed Dec 27, 2023
1 parent a72176a commit 8d285be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions jpegxl-rs/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EncoderResult<u8>, 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(
Expand All @@ -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()
Expand Down

0 comments on commit 8d285be

Please sign in to comment.