Magick.NET
Magick.NET copied to clipboard
`MagickImage.GetColorProfile()` returns non-null value for GIF without color profile
Magick.NET version
13.7.0
Environment (Operating system, version and so on)
Win 11 23h2
Description
- The
MagickImage.GetColorProfile()return non-null for GIF file without color profile. - Accessing child properties causes
System.NotSupportExceptionerror - Note that, in v13.6, the
imgM.GetColorProfile()returnsnullwhich is correct.
The issue is reported at: https://github.com/d2phap/ImageGlass/issues/1907
Steps to Reproduce
- Download sample file:
- Run this code with Magick.NET 13.7:
var path = @"C:\Users\d2pha\Desktop\test.gif";
using var imgM = new MagickImage(path);
var cp = imgM.GetColorProfile();
if (cp != null) // cp is not null here
{
// accessing cp.ColorSpace throws exception
var colorSpaceName = cp.ColorSpace.ToString();
}
- See error:
This is caused by the following bug inside ImageMagick: https://github.com/ImageMagick/ImageMagick/issues/7281. This will be resolved in the next release.