|
|
|
@ -10,12 +10,15 @@ using Xunit; |
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
namespace SixLabors.ImageSharp.Tests |
|
|
|
{ |
|
|
|
using SixLabors.ImageSharp.Advanced; |
|
|
|
|
|
|
|
public class GifDecoderTests |
|
|
|
{ |
|
|
|
private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; |
|
|
|
|
|
|
|
public static readonly string[] TestFiles = { TestImages.Gif.Giphy, TestImages.Gif.Rings, TestImages.Gif.Trans }; |
|
|
|
|
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFileCollection(nameof(TestFiles), PixelTypes)] |
|
|
|
public void DecodeAndReSave<TPixel>(TestImageProvider<TPixel> imageProvider) |
|
|
|
@ -113,5 +116,21 @@ namespace SixLabors.ImageSharp.Tests |
|
|
|
Assert.True(image.Frames.Count > 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void CanDecodeIntermingledImages() |
|
|
|
{ |
|
|
|
using (var kumin1 = Image.Load(TestFile.Create(TestImages.Gif.Kumin).Bytes)) |
|
|
|
using (var icon = Image.Load(TestFile.Create(TestImages.Png.Icon).Bytes)) |
|
|
|
using (var kumin2 = Image.Load(TestFile.Create(TestImages.Gif.Kumin).Bytes)) |
|
|
|
{ |
|
|
|
for (int i = 0; i < kumin1.Frames.Count; i++) |
|
|
|
{ |
|
|
|
ImageFrame<Rgba32> first = kumin1.Frames[i]; |
|
|
|
ImageFrame<Rgba32> second = kumin2.Frames[i]; |
|
|
|
first.ComparePixelBufferTo(second.GetPixelSpan()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |