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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
4 deletions
-
src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs
-
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.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(); |
|
|
|
|
|
|
|
@ -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); |
|
|
|
|