Skip to content

Commit a43948d

Browse files
committed
Make the constructor of ColorProfile that has a name obsolete and only use icc in the future.
1 parent 952057b commit a43948d

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/Magick.NET.Core/Profiles/Color/ColorProfile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
22
// Licensed under the Apache License, Version 2.0.
33

4+
using System;
45
using System.Collections.Generic;
56
using System.Diagnostics.CodeAnalysis;
67
using System.IO;
@@ -49,6 +50,7 @@ public ColorProfile(string fileName)
4950
/// </summary>
5051
/// <param name="name">The name of the color profile (e.g. icc or icm).</param>
5152
/// <param name="data">A byte array containing the profile.</param>
53+
[Obsolete("This constructor will be removed in the next major release (only 'icc' will be used in the future).")]
5254
public ColorProfile(string name, byte[] data)
5355
: base(name, data)
5456
{

src/Magick.NET/MagickImage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7496,7 +7496,7 @@ private void Opaque(IMagickColor<QuantumType> target, IMagickColor<QuantumType>
74967496
if (info is null || info.Datum is null)
74977497
return null;
74987498

7499-
return new ColorProfile(name, info.Datum);
7499+
return new ColorProfile(info.Datum);
75007500
}
75017501

75027502
private void OnArtifact(object? sender, ArtifactEventArgs arguments)

tests/Magick.NET.Tests/MagickImageTests/TheSetProfileMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void ShouldUseTheCorrectProfileName()
6161
profile = image.GetColorProfile();
6262

6363
Assert.NotNull(profile);
64-
Assert.Equal("icm", profile.Name);
64+
Assert.Equal("icc", profile.Name);
6565
Assert.Equal(3144, profile.ToByteArray().Length);
6666
}
6767

0 commit comments

Comments
 (0)