From 53675ef9a6c76b582a24c6e497d468c1657a856c Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 30 Oct 2015 18:07:03 +1100 Subject: [PATCH] Remove multiplication Former-commit-id: 144ecfc26979bbd2bc589ce36ba7188339f1f746 Former-commit-id: 6829fb5a79b7f46df17bacbbc4df662a4012c634 Former-commit-id: 96dc08f0b0b8a16cf9e55eb3c3f1e274479e36a8 --- src/ImageProcessor/Samplers/Resize.cs | 5 ++-- .../Processors/ProcessorTestBase.cs | 14 +++++------ .../Processors/Samplers/SamplerTests.cs | 24 +++++++++---------- .../Formats/Gif/ani.gif.REMOVED.git-id | 1 - 4 files changed, 20 insertions(+), 24 deletions(-) delete mode 100644 tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id diff --git a/src/ImageProcessor/Samplers/Resize.cs b/src/ImageProcessor/Samplers/Resize.cs index 5ab1437f69..c1751ff3ea 100644 --- a/src/ImageProcessor/Samplers/Resize.cs +++ b/src/ImageProcessor/Samplers/Resize.cs @@ -17,7 +17,7 @@ namespace ImageProcessor.Samplers /// /// The epsilon for comparing floating point numbers. /// - private const float Epsilon = 0.0001f; + private const float Epsilon = 0.0000001f; /// /// The horizontal weights. @@ -163,8 +163,7 @@ namespace ImageProcessor.Samplers for (int a = startU; a <= endU; a++) { - // TODO: CHeck multiplier here - float w = 255f * sampler.GetValue((a - fu) / scale); + float w = sampler.GetValue((a - fu) / scale); if (Math.Abs(w) > Epsilon) { diff --git a/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs b/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs index e2023a2c3c..15c073b199 100644 --- a/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs +++ b/tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs @@ -19,19 +19,17 @@ namespace ImageProcessor.Tests /// public static readonly List Files = new List { - "../../TestImages/Formats/Jpg/Backdrop.jpg", + //"../../TestImages/Formats/Jpg/Backdrop.jpg", //"../../TestImages/Formats/Jpg/Calliphora.jpg", - "../../TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg", - "../../TestImages/Formats/Jpg/greyscale.jpg", + //"../../TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg", + //"../../TestImages/Formats/Jpg/greyscale.jpg", //"../../TestImages/Formats/Bmp/Car.bmp", //"../../TestImages/Formats/Png/cmyk.png", //"../../TestImages/Formats/Png/gamma-1.0-or-2.2.png", //"../../TestImages/Formats/Gif/leaf.gif", - //"../../TestImages/Formats/Gif/rings.gif" - - // { "../../TestImages/Formats/Gif/ani.gif" }, - // { "../../TestImages/Formats/Gif/ani2.gif" }, - // { "../../TestImages/Formats/Gif/giphy.gif" }, + //"../../TestImages/Formats/Gif/rings.gif", + //"../../TestImages/Formats/Gif/ani2.gif" , + "../../TestImages/Formats/Gif/giphy.gif" }; } } diff --git a/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs b/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs index c566416fa7..1e71cf112c 100644 --- a/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs +++ b/tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs @@ -15,18 +15,18 @@ namespace ImageProcessor.Tests new TheoryData { { "Bicubic", new BicubicResampler() }, - //{ "Triangle", new TriangleResampler() }, - //{ "Box", new BoxResampler() }, - //{ "Lanczos3", new Lanczos3Resampler() }, - //{ "Lanczos5", new Lanczos5Resampler() }, - //{ "Lanczos8", new Lanczos8Resampler() }, - //{ "MitchellNetravali", new MitchellNetravaliResampler() }, - //{ "Hermite", new HermiteResampler() }, - //{ "Spline", new SplineResampler() }, - //{ "Robidoux", new RobidouxResampler() }, - //{ "RobidouxSharp", new RobidouxSharpResampler() }, - //{ "RobidouxSoft", new RobidouxSoftResampler() }, - //{ "Welch", new WelchResampler() } + { "Triangle", new TriangleResampler() }, + { "Box", new BoxResampler() }, + { "Lanczos3", new Lanczos3Resampler() }, + { "Lanczos5", new Lanczos5Resampler() }, + { "Lanczos8", new Lanczos8Resampler() }, + { "MitchellNetravali", new MitchellNetravaliResampler() }, + { "Hermite", new HermiteResampler() }, + { "Spline", new SplineResampler() }, + { "Robidoux", new RobidouxResampler() }, + { "RobidouxSharp", new RobidouxSharpResampler() }, + { "RobidouxSoft", new RobidouxSoftResampler() }, + { "Welch", new WelchResampler() } }; [Theory] diff --git a/tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id b/tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id deleted file mode 100644 index 9b07936a0f..0000000000 --- a/tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a0cc93222effb5feec0d1a1dc45efd0c5af77450 \ No newline at end of file