Take u8 slice for icc profile
This commit is contained in:
parent
4b21730bb3
commit
237a560e34
1 changed files with 2 additions and 2 deletions
|
|
@ -376,9 +376,9 @@ impl RawImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add an ICC profile for the image
|
/// 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
|
// 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);
|
let mut iccp = Vec::with_capacity(compressed.len() + 13);
|
||||||
iccp.extend(b"icc"); // Profile name - generally unused, can be anything
|
iccp.extend(b"icc"); // Profile name - generally unused, can be anything
|
||||||
iccp.extend([0, 0]); // Null separator, zlib compression method
|
iccp.extend([0, 0]); // Null separator, zlib compression method
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue