diff --git a/src/ImageSharp/Processing/ImageProcessor.cs b/src/ImageSharp/Processing/ImageProcessor.cs index bf88d5ff7..a4ed4eb98 100644 --- a/src/ImageSharp/Processing/ImageProcessor.cs +++ b/src/ImageSharp/Processing/ImageProcessor.cs @@ -42,10 +42,10 @@ namespace ImageSharp.Processing foreach (ImageFrame sourceFrame in source.Frames) { - this.BeforeApply(source, sourceRectangle); + this.BeforeApply(sourceFrame, sourceRectangle); - this.OnApply(source, sourceRectangle); - this.AfterApply(source, sourceRectangle); + this.OnApply(sourceFrame, sourceRectangle); + this.AfterApply(sourceFrame, sourceRectangle); } this.AfterImageApply(source, sourceRectangle); diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index 06bfd8990..f74c7a5a7 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -11,6 +11,7 @@ namespace ImageSharp.Tests using ImageSharp.Formats; using ImageSharp.PixelFormats; + using SixLabors.Primitives; public class GifDecoderTests { @@ -29,7 +30,20 @@ namespace ImageSharp.Tests imageProvider.Utility.SaveTestOutputFile(image, "gif"); } } - + [Theory] + [WithFileCollection(nameof(TestFiles), PixelTypes)] + public void DecodeResizeAndSave(TestImageProvider imageProvider) + where TPixel : struct, IPixel + { + using (Image image = imageProvider.GetImage()) + { + image.Mutate(x => x.Resize(new Size(image.Width / 2, image.Height / 2))); + + imageProvider.Utility.SaveTestOutputFile(image, "bmp"); + imageProvider.Utility.SaveTestOutputFile(image, "gif"); + } + } + [Fact] public void Decode_IgnoreMetadataIsFalse_CommentsAreRead() {