Skip to content

Commit cc39c50

Browse files
committed
Add test case for issue 2763
1 parent 00b253d commit cc39c50

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,23 @@ public void Encode_Lossy_WorksWithTestPattern<TPixel>(TestImageProvider<TPixel>
497497
image.VerifyEncoder(provider, "webp", string.Empty, encoder, ImageComparer.Tolerant(0.04f));
498498
}
499499

500+
// https://github.com/SixLabors/ImageSharp/issues/2763
501+
[Theory]
502+
[WithFile(Lossy.Issue2763, PixelTypes.Rgba32)]
503+
public void WebpDecoder_CanDecode_Issue2763<TPixel>(TestImageProvider<TPixel> provider)
504+
where TPixel : unmanaged, IPixel<TPixel>
505+
{
506+
WebpEncoder encoder = new()
507+
{
508+
Quality = 84,
509+
FileFormat = WebpFileFormatType.Lossless
510+
};
511+
512+
using Image<TPixel> image = provider.GetImage(PngDecoder.Instance);
513+
image.DebugSave(provider);
514+
image.VerifyEncoder(provider, "webp", string.Empty, encoder);
515+
}
516+
500517
public static void RunEncodeLossy_WithPeakImage()
501518
{
502519
TestImageProvider<Rgba32> provider = TestImageProvider<Rgba32>.File(TestImageLossyFullPath);

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ public static class Lossy
821821
public const string Issue2243 = "Webp/issues/Issue2243.webp";
822822
public const string Issue2257 = "Webp/issues/Issue2257.webp";
823823
public const string Issue2670 = "Webp/issues/Issue2670.webp";
824+
public const string Issue2763 = "Webp/issues/Issue2763.png";
824825
}
825826
}
826827

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)