From 2ea3c2bc3fa8749642614e6a6afea3bd694693ea Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 7 Jan 2016 23:56:14 +1100 Subject: [PATCH] Fix weight count Helps mitigate halo bug with gifs. Former-commit-id: 9307909acd7eb38e5a6c722c2f1ce2c949ca4a9c Former-commit-id: 7e53310efb4390de53880066e1798c5e77cdd649 Former-commit-id: 4bd4a70b5a3c64f39dd95203d8ad8bf31a394b11 --- src/ImageProcessor/Samplers/Resampler.cs | 2 +- .../ImageProcessor.Tests/Processors/ProcessorTestBase.cs | 8 ++++---- .../Processors/Samplers/SamplerTests.cs | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ImageProcessor/Samplers/Resampler.cs b/src/ImageProcessor/Samplers/Resampler.cs index 835144ae7..b490a8203 100644 --- a/src/ImageProcessor/Samplers/Resampler.cs +++ b/src/ImageProcessor/Samplers/Resampler.cs @@ -327,7 +327,7 @@ namespace ImageProcessor.Samplers float du = sourceSize / (float)destinationSize; float scale = du; - if (scale < 1) + if (scale > 1) { scale = 1; } diff --git a/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs b/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs index dcb474f95..9a3e1181b 100644 --- a/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs +++ b/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs @@ -19,14 +19,14 @@ namespace ImageProcessor.Tests /// public static readonly List Files = new List { - //"TestImages/Formats/Jpg/Floorplan.jpeg", //Perf: Enable for local testing only + //"TestImages/Formats/Jpg/Floorplan.jpeg", // Perf: Enable for local testing only "TestImages/Formats/Jpg/Calliphora.jpg", - //"TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg", //Perf: Enable for local testing only + //"TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg", // Perf: Enable for local testing only "TestImages/Formats/Bmp/Car.bmp", - //"TestImages/Formats/Png/blur.png", //Perf: Enable for local testing only + //"TestImages/Formats/Png/blur.png", // Perf: Enable for local testing only "TestImages/Formats/Png/splash.png", "TestImages/Formats/Gif/rings.gif", - //"TestImages/Formats/Gif/giphy.gif" //Perf: Enable for local testing only + //"TestImages/Formats/Gif/giphy.gif" // Perf: Enable for local testing only }; } } diff --git a/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs b/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs index d60ab5139..04709b883 100644 --- a/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs +++ b/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs @@ -15,6 +15,7 @@ { { "Bicubic", new BicubicResampler() }, { "Triangle", new TriangleResampler() }, + // Perf: Enable for local testing only //{ "Box", new BoxResampler() }, //{ "Lanczos3", new Lanczos3Resampler() }, //{ "Lanczos5", new Lanczos5Resampler() },