|
21 | 21 | namespace SixLabors.ImageSharp.Tests.Formats.Jpg |
22 | 22 | { |
23 | 23 | // TODO: Scatter test cases into multiple test classes |
24 | | - [Trait("Format", "Jpg")] |
| 24 | + [Trait("Format", "Jpg")] |
25 | 25 | public partial class JpegDecoderTests |
26 | 26 | { |
27 | 27 | public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.Bgr24 | PixelTypes.RgbaVector; |
@@ -65,7 +65,7 @@ private static bool SkipTest(ITestImageProvider provider) |
65 | 65 |
|
66 | 66 | private ITestOutputHelper Output { get; } |
67 | 67 |
|
68 | | - private static JpegDecoder JpegDecoder => new JpegDecoder(); |
| 68 | + private static JpegDecoder JpegDecoder => new(); |
69 | 69 |
|
70 | 70 | [Fact] |
71 | 71 | public void ParseStream_BasicPropertiesAreCorrect() |
@@ -213,6 +213,19 @@ public void Issue1732_DecodesWithRgbColorSpace<TPixel>(TestImageProvider<TPixel> |
213 | 213 | } |
214 | 214 | } |
215 | 215 |
|
| 216 | + // https://github.com/SixLabors/ImageSharp/issues/2057 |
| 217 | + [Theory] |
| 218 | + [WithFile(TestImages.Jpeg.Issues.Issue2057App1Parsing, PixelTypes.Rgba32)] |
| 219 | + public void Issue2057_DecodeWorks<TPixel>(TestImageProvider<TPixel> provider) |
| 220 | + where TPixel : unmanaged, IPixel<TPixel> |
| 221 | + { |
| 222 | + using (Image<TPixel> image = provider.GetImage(JpegDecoder)) |
| 223 | + { |
| 224 | + image.DebugSave(provider); |
| 225 | + image.CompareToOriginal(provider); |
| 226 | + } |
| 227 | + } |
| 228 | + |
216 | 229 | // DEBUG ONLY! |
217 | 230 | // The PDF.js output should be saved by "tests\ImageSharp.Tests\Formats\Jpg\pdfjs\jpeg-converter.htm" |
218 | 231 | // into "\tests\Images\ActualOutput\JpegDecoderTests\" |
|
0 commit comments