Browse Source

fix apply processors to frames

pull/275/head
Scott Williams 9 years ago
parent
commit
88e30a0134
  1. 6
      src/ImageSharp/Processing/ImageProcessor.cs
  2. 16
      tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

6
src/ImageSharp/Processing/ImageProcessor.cs

@ -42,10 +42,10 @@ namespace ImageSharp.Processing
foreach (ImageFrame<TPixel> 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);

16
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<TPixel>(TestImageProvider<TPixel> imageProvider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> 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()
{

Loading…
Cancel
Save