Skip to content

Commit e8f9841

Browse files
Remove bad code and tests
1 parent 1d27038 commit e8f9841

6 files changed

Lines changed: 3 additions & 244 deletions

File tree

src/ImageSharp/ColorProfiles/ColorProfileConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ColorProfileConverter
1212
/// Initializes a new instance of the <see cref="ColorProfileConverter"/> class.
1313
/// </summary>
1414
public ColorProfileConverter()
15-
: this(new())
15+
: this(new())
1616
{
1717
}
1818

src/ImageSharp/ColorProfiles/Icc/IccProfileConverter.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/ImageSharp/Formats/DecoderOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ public sealed class DecoderOptions
6262

6363
/// <summary>
6464
/// Gets a value that controls how ICC profiles are handled during decode.
65+
/// TODO: Implement this.
6566
/// </summary>
66-
public ColorProfileHandling ColorProfileHandling { get; init; }
67+
internal ColorProfileHandling ColorProfileHandling { get; init; }
6768

6869
internal void SetConfiguration(Configuration configuration) => this.configuration = configuration;
6970
}

src/ImageSharp/Formats/ImageDecoder.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using SixLabors.ImageSharp.ColorProfiles.Icc;
5-
using SixLabors.ImageSharp.ColorSpaces.Conversion.Icc;
64
using SixLabors.ImageSharp.IO;
75
using SixLabors.ImageSharp.Metadata;
8-
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
96
using SixLabors.ImageSharp.PixelFormats;
107
using SixLabors.ImageSharp.Processing;
118

@@ -26,7 +23,6 @@ public Image<TPixel> Decode<TPixel>(DecoderOptions options, Stream stream)
2623
stream,
2724
s => this.Decode<TPixel>(options, s, default));
2825

29-
TransformColorProfile(options, image);
3026
this.SetDecoderFormat(options.Configuration, image);
3127

3228
return image;
@@ -40,7 +36,6 @@ public Image Decode(DecoderOptions options, Stream stream)
4036
stream,
4137
s => this.Decode(options, s, default));
4238

43-
TransformColorProfile(options, image);
4439
this.SetDecoderFormat(options.Configuration, image);
4540

4641
return image;
@@ -56,7 +51,6 @@ public async Task<Image<TPixel>> DecodeAsync<TPixel>(DecoderOptions options, Str
5651
(s, ct) => this.Decode<TPixel>(options, s, ct),
5752
cancellationToken).ConfigureAwait(false);
5853

59-
TransformColorProfile(options, image);
6054
this.SetDecoderFormat(options.Configuration, image);
6155

6256
return image;
@@ -71,7 +65,6 @@ public async Task<Image> DecodeAsync(DecoderOptions options, Stream stream, Canc
7165
(s, ct) => this.Decode(options, s, ct),
7266
cancellationToken).ConfigureAwait(false);
7367

74-
TransformColorProfile(options, image);
7568
this.SetDecoderFormat(options.Configuration, image);
7669

7770
return image;
@@ -166,25 +159,6 @@ protected static void ScaleToTargetSize(DecoderOptions options, Image image)
166159
}
167160
}
168161

169-
/// <summary>
170-
/// Converts the decoded image color profile if present to a V4 sRGB profile.
171-
/// </summary>
172-
/// <param name="options">The decoder options.</param>
173-
/// <param name="image">The image.</param>
174-
protected static void TransformColorProfile(DecoderOptions options, Image image)
175-
{
176-
if (options.ColorProfileHandling == ColorProfileHandling.Preserve)
177-
{
178-
return;
179-
}
180-
181-
IccProfile? profile = image.Metadata?.IccProfile;
182-
if (profile is not null)
183-
{
184-
IccProfileConverter.Convert(image, profile, SrgbV4Profile.GetProfile());
185-
}
186-
}
187-
188162
/// <summary>
189163
/// Determines whether the decoded image should be resized.
190164
/// </summary>

src/ImageSharp/Formats/SpecializedImageDecoder{T}.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public Image<TPixel> Decode<TPixel>(T options, Stream stream)
2323
stream,
2424
s => this.Decode<TPixel>(options, s, default));
2525

26-
TransformColorProfile(options.GeneralOptions, image);
2726
this.SetDecoderFormat(options.GeneralOptions.Configuration, image);
2827

2928
return image;
@@ -37,7 +36,6 @@ public Image Decode(T options, Stream stream)
3736
stream,
3837
s => this.Decode(options, s, default));
3938

40-
TransformColorProfile(options.GeneralOptions, image);
4139
this.SetDecoderFormat(options.GeneralOptions.Configuration, image);
4240

4341
return image;
@@ -53,7 +51,6 @@ public async Task<Image<TPixel>> DecodeAsync<TPixel>(T options, Stream stream, C
5351
(s, ct) => this.Decode<TPixel>(options, s, ct),
5452
cancellationToken).ConfigureAwait(false);
5553

56-
TransformColorProfile(options.GeneralOptions, image);
5754
this.SetDecoderFormat(options.GeneralOptions.Configuration, image);
5855

5956
return image;
@@ -68,7 +65,6 @@ public async Task<Image> DecodeAsync(T options, Stream stream, CancellationToken
6865
(s, ct) => this.Decode(options, s, ct),
6966
cancellationToken).ConfigureAwait(false);
7067

71-
TransformColorProfile(options.GeneralOptions, image);
7268
this.SetDecoderFormat(options.GeneralOptions.Configuration, image);
7369

7470
return image;

tests/ImageSharp.Tests/ColorProfiles/Icc/IccProfileConverterTests.cs

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)