|
|
|
@ -13,19 +13,30 @@ namespace SixLabors.ImageSharp.Tests |
|
|
|
{ |
|
|
|
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; |
|
|
|
|
|
|
|
// TODO: Fix all bugs, and re enable Skipped and commented stuff !!!
|
|
|
|
public class PngDecoderTests |
|
|
|
{ |
|
|
|
private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; |
|
|
|
|
|
|
|
public static readonly string[] CommonTestImages = |
|
|
|
{ |
|
|
|
TestImages.Png.Splash, TestImages.Png.Indexed, TestImages.Png.Interlaced, TestImages.Png.FilterVar, |
|
|
|
TestImages.Png.Bad.ChunkLength1, TestImages.Png.Bad.ChunkLength2, TestImages.Png.SnakeGame |
|
|
|
TestImages.Png.Splash, TestImages.Png.Indexed, |
|
|
|
TestImages.Png.FilterVar, |
|
|
|
TestImages.Png.Bad.ChunkLength1, |
|
|
|
TestImages.Png.Bad.ChunkLength2, |
|
|
|
|
|
|
|
// BUG !!! Should work. TODO: Fix it !!!!
|
|
|
|
// TestImages.Png.SnakeGame
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly string[] TestImages48Bpp = |
|
|
|
{ |
|
|
|
TestImages.Png.Rgb48Bpp, TestImages.Png.Rgb48BppInterlaced |
|
|
|
TestImages.Png.Rgb48Bpp, |
|
|
|
|
|
|
|
// TODO: Re enable, when Decode_Interlaced is fixed!!!!
|
|
|
|
// TestImages.Png.Rgb48BppInterlaced
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
@ -41,6 +52,19 @@ namespace SixLabors.ImageSharp.Tests |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// BUG in decoding interlaced images !!! TODO: Fix it!
|
|
|
|
[Theory(Skip = "Bug in decoding interlaced images.")] |
|
|
|
[WithFile(TestImages.Png.Interlaced, PixelTypes.Rgba32)] |
|
|
|
public void Decode_Interlaced<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
|
{ |
|
|
|
using (Image<TPixel> image = provider.GetImage(new PngDecoder())) |
|
|
|
{ |
|
|
|
image.DebugSave(provider); |
|
|
|
image.CompareToOriginal(provider, ImageComparer.Exact); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: We need to decode these into Rgba64 properly, and do 'CompareToOriginal' in a Rgba64 mode! (See #285)
|
|
|
|
[Theory] |
|
|
|
[WithFileCollection(nameof(TestImages48Bpp), PixelTypes.Rgba32)] |
|
|
|
@ -58,8 +82,7 @@ namespace SixLabors.ImageSharp.Tests |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(TestImages.Png.Splash, PixelTypes)] |
|
|
|
public void Decoder_IsNotBoundToSinglePixelType<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
|