Take u8 slice for icc profile

This commit is contained in:
Andrew 2023-05-12 09:09:24 +12:00
parent 4b21730bb3
commit 237a560e34

View file

@ -376,9 +376,9 @@ impl RawImage {
}
/// Add an ICC profile for the image
pub fn add_icc_profile(&mut self, data: Vec<u8>) {
pub fn add_icc_profile(&mut self, data: &[u8]) {
// Compress with default compression level
if let Ok(mut compressed) = deflate::deflate(&data, 11, &AtomicMin::new(None)) {
if let Ok(mut compressed) = deflate::deflate(data, 11, &AtomicMin::new(None)) {
let mut iccp = Vec::with_capacity(compressed.len() + 13);
iccp.extend(b"icc"); // Profile name - generally unused, can be anything
iccp.extend([0, 0]); // Null separator, zlib compression method