|
|
|
@ -21,7 +21,7 @@ using Xunit.Abstractions; |
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Jpg |
|
|
|
{ |
|
|
|
// TODO: Scatter test cases into multiple test classes
|
|
|
|
[Trait("Format", "Jpg")] |
|
|
|
[Trait("Format", "Jpg")] |
|
|
|
public partial class JpegDecoderTests |
|
|
|
{ |
|
|
|
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.Bgr24 | PixelTypes.RgbaVector; |
|
|
|
@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg |
|
|
|
|
|
|
|
private ITestOutputHelper Output { get; } |
|
|
|
|
|
|
|
private static JpegDecoder JpegDecoder => new JpegDecoder(); |
|
|
|
private static JpegDecoder JpegDecoder => new(); |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void ParseStream_BasicPropertiesAreCorrect() |
|
|
|
@ -213,6 +213,19 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// https://github.com/SixLabors/ImageSharp/issues/2057
|
|
|
|
[Theory] |
|
|
|
[WithFile(TestImages.Jpeg.Issues.Issue2057App1Parsing, PixelTypes.Rgba32)] |
|
|
|
public void Issue2057_DecodeWorks<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
using (Image<TPixel> image = provider.GetImage(JpegDecoder)) |
|
|
|
{ |
|
|
|
image.DebugSave(provider); |
|
|
|
image.CompareToOriginal(provider); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// DEBUG ONLY!
|
|
|
|
// The PDF.js output should be saved by "tests\ImageSharp.Tests\Formats\Jpg\pdfjs\jpeg-converter.htm"
|
|
|
|
// into "\tests\Images\ActualOutput\JpegDecoderTests\"
|
|
|
|
|