Prerequisites
ImageSharp version
4.0.0
Other ImageSharp packages and versions
NA
Environment (Operating system, version and so on)
Ubuntu 24.04
.NET Framework version
net10
Description
Hello,
When loading a .tiff with an icc profile and the option ColorProfileHandling.Preserve the profile is not applied (as expected) but the field Metadata.IccProfile is null so the info about the profile is lost.
If I encode the image as JPEG afterward, the profile not saved in the file.
Steps to Reproduce
Console.WriteLine("Preserve:");
using var imgPreserve = Image.Load(new DecoderOptions
{
ColorProfileHandling = ColorProfileHandling.Preserve,
},
"tiff_test_image_with_icc_profile.tiff"
);
Console.WriteLine(" IccProfile: " + (imgPreserve.Metadata.IccProfile?.ToString() ?? "null"));
imgPreserve.Save("image.icc.preserverd.jpg");
Console.WriteLine(" File: " + Path.Combine("file: " + Path.GetFullPath("image.icc.preserverd.jpg")));
Console.WriteLine("Convert:");
using var imgConvert = Image.Load(new DecoderOptions
{
ColorProfileHandling = ColorProfileHandling.Convert,
},
"tiff_test_image_with_icc_profile.tiff"
);
Console.WriteLine(" IccProfile: " + (imgConvert.Metadata.IccProfile?.ToString() ?? "null"));
imgConvert.Save("image.icc.converted.jpg");
Console.WriteLine(" File: " + Path.Combine("file: " + Path.GetFullPath("image.icc.converted.jpg")));
Images
The tiff:
tiff_test_image_with_icc_profile.tiff
image.icc.converted.jpg: (Correct)

image.icc.preserverd.jpg: (Invalid)

Prerequisites
DEBUGandRELEASEmodeImageSharp version
4.0.0
Other ImageSharp packages and versions
NA
Environment (Operating system, version and so on)
Ubuntu 24.04
.NET Framework version
net10
Description
Hello,
When loading a .tiff with an icc profile and the option
ColorProfileHandling.Preservethe profile is not applied (as expected) but the fieldMetadata.IccProfileisnullso the info about the profile is lost.If I encode the image as JPEG afterward, the profile not saved in the file.
Steps to Reproduce
Images
The tiff:
tiff_test_image_with_icc_profile.tiff
image.icc.converted.jpg: (Correct)

image.icc.preserverd.jpg: (Invalid)
