Expose shared embedded ICC extraction

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 01:15:30 -05:00
1 parent c6ae974743
commit a47b78256c
2 files changed
+9 -1

No files matched your search

+8
View File
@@ -3,6 +3,14 @@
use crate::error::CodecError;
use crate::{ChannelLayout, DecodeOptions, Format, Limits, SampleType, decode_with};
/// Return an embedded ICC profile using the selected format decoder.
///
/// This fully decodes the image; callers that already need the pixels should read `Image::meta.icc`
/// from that decode instead of invoking this helper separately.
pub fn embedded_icc(bytes: &[u8]) -> Result<Option<Vec<u8>>, CodecError> {
Ok(decode_with(bytes, &DecodeOptions::default())?.icc)
}
/// The source pixel model reported by an image container, before decode normalizes it.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RasterColorType {
+1 -1
View File
@@ -48,7 +48,7 @@ pub use crate::image::{
ChannelLayout, CryptomatteBuffer, CryptomatteLayer, DecodeWarning, DeepChannel, DeepImage, ExrChannelInfo, ExrPartInfo, ExtraSample, Image,
MAX_EXTRA_SAMPLES, Metadata, SampleType, convert_samples,
};
pub use crate::inspection::{RasterColorType, RasterInspection, ToneClass, classify_tone, inspect_raster};
pub use crate::inspection::{RasterColorType, RasterInspection, ToneClass, classify_tone, embedded_icc, inspect_raster};
pub use crate::options::{
DdsCompression, DdsOptions, DecodeOptions, DpxBits, EncodeOptions, ExrCompression, JpegFormat, Limits, PngCompression, PngStereo,
TIFF_PYRAMID_MIN, TiffCompression,