Skip to content

Commit a666e15

Browse files
committed
Improved check to determine if the image already has a color profile.
1 parent cc04f1a commit a666e15

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Magick.NET/MagickImage.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,9 @@ public VirtualPixelMethod VirtualPixelMethod
931931
public int Width
932932
=> _nativeInstance.Width;
933933

934+
private bool HasColorProfile
935+
=> HasProfile("icc") || HasProfile("icm");
936+
934937
/// <summary>
935938
/// Determines whether the first <see cref="MagickImage"/> is more than the second <see cref="MagickImage"/>.
936939
/// </summary>
@@ -6653,7 +6656,7 @@ public bool TransformColorSpace(IColorProfile target, ColorTransformMode mode)
66536656
{
66546657
Throw.IfNull(nameof(target), target);
66556658

6656-
if (!HasProfile(target.Name))
6659+
if (!HasColorProfile)
66576660
return false;
66586661

66596662
SetProfile(target, mode);
@@ -6689,7 +6692,7 @@ public bool TransformColorSpace(IColorProfile source, IColorProfile target, Colo
66896692
if (source.ColorSpace != ColorSpace)
66906693
return false;
66916694

6692-
if (!HasProfile(target.Name))
6695+
if (!HasColorProfile)
66936696
SetProfile(source);
66946697

66956698
SetProfile(target, mode);

0 commit comments

Comments
 (0)