Magick.NET icon indicating copy to clipboard operation
Magick.NET copied to clipboard

`MagickImage.GetColorProfile()` returns non-null value for GIF without color profile

Open d2phap opened this issue 1 year ago • 1 comments

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.NotSupportException error
  • Note that, in v13.6, the imgM.GetColorProfile() returns null which is correct.

The issue is reported at: https://github.com/d2phap/ImageGlass/issues/1907

Steps to Reproduce

  1. Download sample file: test.gif
  2. 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();
}
  1. See error: image

d2phap avatar May 07 '24 13:05 d2phap

This is caused by the following bug inside ImageMagick: https://github.com/ImageMagick/ImageMagick/issues/7281. This will be resolved in the next release.

dlemstra avatar May 07 '24 17:05 dlemstra