Skip to content

Commit 55d6711

Browse files
Add test
1 parent 99aadf6 commit 55d6711

6 files changed

Lines changed: 32 additions & 0 deletions

File tree

tests/ImageSharp.Tests/Drawing/DrawImageTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,21 @@ public void Issue2603<TPixel>(TestImageProvider<TPixel> provider)
293293
appendPixelTypeToFileName: false,
294294
appendSourceFileOrDescription: false);
295295
}
296+
297+
[Theory]
298+
[WithFile(TestImages.Gif.Giphy, PixelTypes.Rgba32)]
299+
public void DrawImageAnimatedForegroundRepeatCount<TPixel>(TestImageProvider<TPixel> provider)
300+
where TPixel : unmanaged, IPixel<TPixel>
301+
{
302+
using Image<TPixel> background = provider.GetImage();
303+
using Image<TPixel> foreground = Image.Load<TPixel>(TestFile.Create(TestImages.Gif.Giphy).Bytes);
304+
305+
Size size = new(foreground.Width / 4, foreground.Height / 4);
306+
foreground.Mutate(x => x.Resize(size.Width, size.Height, KnownResamplers.Bicubic));
307+
308+
background.Mutate(x => x.DrawImage(foreground, Point.Empty, 1F, 0));
309+
310+
background.DebugSaveMultiFrame(provider);
311+
background.CompareToReferenceOutputMultiFrame(provider, ImageComparer.TolerantPercentage(0.01f));
312+
}
296313
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)