Skip to content

Commit 9d04ae4

Browse files
committed
Add test case for #2133
1 parent dd6b4c1 commit 9d04ae4

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ public void Issue2057_DecodeWorks<TPixel>(TestImageProvider<TPixel> provider)
218218
}
219219
}
220220

221+
// https://github.com/SixLabors/ImageSharp/issues/2133
222+
[Theory]
223+
[WithFile(TestImages.Jpeg.Issues.Issue2133DeduceColorSpace, PixelTypes.Rgba32)]
224+
public void Issue2133_DeduceColorSpace<TPixel>(TestImageProvider<TPixel> provider)
225+
where TPixel : unmanaged, IPixel<TPixel>
226+
{
227+
using (Image<TPixel> image = provider.GetImage(JpegDecoder))
228+
{
229+
image.DebugSave(provider);
230+
image.CompareToOriginal(provider);
231+
}
232+
}
233+
221234
// DEBUG ONLY!
222235
// The PDF.js output should be saved by "tests\ImageSharp.Tests\Formats\Jpg\pdfjs\jpeg-converter.htm"
223236
// into "\tests\Images\ActualOutput\JpegDecoderTests\"

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ public static class Issues
272272
public const string Issue2057App1Parsing = "Jpg/issues/Issue2057-App1Parsing.jpg";
273273
public const string ExifNullArrayTag = "Jpg/issues/issue-2056-exif-null-array.jpg";
274274
public const string ValidExifArgumentNullExceptionOnEncode = "Jpg/issues/Issue2087-exif-null-reference-on-encode.jpg";
275+
public const string Issue2133DeduceColorSpace = "Jpg/issues/Issue2133.jpg";
275276

276277
public static class Fuzz
277278
{
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)