Skip to content

Commit 6f38753

Browse files
Add image and test
1 parent b8d1cd8 commit 6f38753

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,21 @@ public async Task CanSave_NonSeekableStream_Async<TPixel>(TestImageProvider<TPix
582582
Assert.True(seekable.ToArray().SequenceEqual(memoryStream.ToArray()));
583583
}
584584

585+
// https://github.com/SixLabors/ImageSharp/issues/2866
586+
[Theory]
587+
[WithFile(Lossy.Issue2866, PixelTypes.Rgba32)]
588+
public void WebpDecoder_CanDecode_Issue2866<TPixel>(TestImageProvider<TPixel> provider)
589+
where TPixel : unmanaged, IPixel<TPixel>
590+
{
591+
WebpEncoder encoder = new()
592+
{
593+
Quality = 100
594+
};
595+
596+
using Image<TPixel> image = provider.GetImage();
597+
image.VerifyEncoder(provider, "webp", string.Empty, encoder, ImageComparer.TolerantPercentage(0.0994F));
598+
}
599+
585600
private static ImageComparer GetComparer(int quality)
586601
{
587602
float tolerance = 0.01f; // ~1.0%

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ public static class Lossy
825825
public const string Issue2670 = "Webp/issues/Issue2670.webp";
826826
public const string Issue2763 = "Webp/issues/Issue2763.png";
827827
public const string Issue2801 = "Webp/issues/Issue2801.webp";
828+
public const string Issue2866 = "Webp/issues/Issue2866.webp";
828829
}
829830
}
830831

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:15e8a52a6d528fe071e73b037543b682bf62da7bab6d98ab690f25dd97f7298e
3+
size 248688

0 commit comments

Comments
 (0)