Browse Source

Add test for Issue 2528

pull/2547/head
Brian Popow 3 years ago
parent
commit
22935fd25f
  1. 19
      tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Webp/issues/Issue2528.webp

19
tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs

@ -1,7 +1,6 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Webp;
@ -340,6 +339,24 @@ public class WebpDecoderTests
Assert.Equal(1, image.Frames.Count);
}
[Theory]
[WithFile(Lossy.AnimatedIssue2528, PixelTypes.Rgba32)]
public void Decode_AnimatedLossy_IgnoreBackgroundColor_Works<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
WebpDecoderOptions options = new()
{
BackgroundColorHandling = BackgroundColorHandling.Ignore,
GeneralOptions = new DecoderOptions()
{
MaxFrames = 1
}
};
using Image<TPixel> image = provider.GetImage(WebpDecoder.Instance, options);
image.DebugSave(provider);
image.CompareToOriginal(provider, ReferenceDecoder);
}
[Theory]
[WithFile(Lossless.LossLessCorruptImage1, PixelTypes.Rgba32)]
[WithFile(Lossless.LossLessCorruptImage2, PixelTypes.Rgba32)]

1
tests/ImageSharp.Tests/TestImages.cs

@ -677,6 +677,7 @@ public static class TestImages
public const string WithXmp = "Webp/xmp_lossy.webp";
public const string BikeSmall = "Webp/bike_lossy_small.webp";
public const string Animated = "Webp/leo_animated_lossy.webp";
public const string AnimatedIssue2528 = "Webp/Issues/Issue2528.webp";
// Lossy images without macroblock filtering.
public const string BikeWithExif = "Webp/bike_lossy_with_exif.webp";

3
tests/Images/Input/Webp/issues/Issue2528.webp

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b4aa2ba2e6ef0263b5b657e4d15241d497721a0461250b1d942751812b96de71
size 60214
Loading…
Cancel
Save