Merge pull request #3322 from dotCooCoo/fix/png-borrow-icc-profile

image-codecs: borrow the ICC profile and EXIF in the PNG header
This commit is contained in:
BFlat
2026-11-26 10:27:00 +07:00
committed by GitHub
+2 -2
View File
@@ -1390,12 +1390,12 @@ fn start<W: Write>(
if opts.embed_icc
&& let Some(icc) = icc
{
info.icc_profile = Some(icc.clone().into());
info.icc_profile = Some(std::borrow::Cow::Borrowed(icc.as_slice()));
}
if opts.embed_metadata {
if let Some(exif) = &meta.exif {
// The pixels are written as they are shown: never let a viewer rotate them again.
info.exif_metadata = Some(crate::resolution::export_exif(exif, meta.dpi).into_owned().into());
info.exif_metadata = Some(crate::resolution::export_exif(exif, meta.dpi));
}
if let Some((x, y)) = meta.dpi
&& x > 0.0