Skip to content

Commit

Permalink
fix: make set_icc_profile function available
Browse files Browse the repository at this point in the history
  • Loading branch information
misl-smlz committed Sep 25, 2024
1 parent c708281 commit 562cfbb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/codecs/webp/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ impl<W: Write> ImageEncoder for WebPEncoder<W> {
) -> ImageResult<()> {
self.encode(buf, width, height, color_type)
}

fn set_icc_profile(&mut self, icc_profile: Vec<u8>) {
self.inner.set_icc_profile(icc_profile);
}
}

impl ImageError {
Expand Down
11 changes: 11 additions & 0 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,17 @@ pub trait ImageEncoder {
height: u32,
color_type: ExtendedColorType,
) -> ImageResult<()>;

/// Set the ICC profile to use for the image.
///
/// # Panics
///
/// Panics if the ICC profile is not implemented for the format.
fn set_icc_profile(&mut self, icc_profile: Vec<u8>) {
let _ = icc_profile;
panic!("ICC profiles are not supported for this format");
}

}

/// Immutable pixel iterator
Expand Down

0 comments on commit 562cfbb

Please sign in to comment.