Browse Source

Merge pull request #492 from SixLabors/js/fix-multi-frame-resize

Fix non-nearest-neighbour resize for multi-frame-images
af/merge-core
James Jackson-South 8 years ago
committed by GitHub
parent
commit
95eb82da05
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs
  2. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

5
src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs

@ -368,10 +368,9 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
}
}
/// <inheritdoc />
protected override void AfterFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Rectangle sourceRectangle, Configuration configuration)
protected override void AfterImageApply(Image<TPixel> source, Image<TPixel> destination, Rectangle sourceRectangle)
{
base.AfterFrameApply(source, destination, sourceRectangle, configuration);
base.AfterImageApply(source, destination, sourceRectangle);
// TODO: An exception in the processing chain can leave these buffers undisposed. We should consider making image processors IDisposable!
this.horizontalWeights?.Dispose();

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

@ -102,7 +102,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
{
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, KnownResamplers.NearestNeighbor));
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, KnownResamplers.Bicubic));
// Comparer fights decoder with gif-s. Could not use CompareToReferenceOutput here :(
image.DebugSave(provider, extension: Extensions.Gif);

Loading…
Cancel
Save