Skip to content

Commit 87ae48c

Browse files
committed
Don't resize the image for the phase tests to avoid issue with different values for each quantum.
1 parent 4addf8e commit 87ae48c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/Magick.NET.Tests/MagickImageTests/TheCompareMethod.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,23 +209,25 @@ public void ShouldReturnTheCorrectValueForEachErrorMetricForImageWithAlphaChanne
209209
[Fact]
210210
public void ShouldReturnTheCorrectValueForPhaseCorrelationErrorMetric()
211211
{
212-
using var image = new MagickImage(Files.Builtin.Logo);
213-
image.Resize(64, 64);
212+
using var image = new MagickImage(Files.ImageMagickICO);
214213
using var other = image.CloneAndMutate(image => image.Rotate(180));
215214

216215
var result = image.Compare(other, ErrorMetric.PhaseCorrelation);
217-
Assert.InRange(result, 0.1871, 0.1872);
216+
Assert.InRange(result, 0.3225, 0.3226);
218217
}
219218

220219
[Fact]
221220
public void ShouldReturnTheCorrectValueForPhaseCorrelationErrorMetricWithAlphaChannel()
222221
{
223-
using var image = new MagickImage(Files.MagickNETIconPNG);
224-
image.Resize(64, 64);
222+
var settings = new MagickReadSettings
223+
{
224+
FrameIndex = 1,
225+
};
226+
using var image = new MagickImage(Files.WandICO, settings);
225227
using var other = image.CloneAndMutate(image => image.Rotate(180));
226228

227229
var result = image.Compare(other, ErrorMetric.PhaseCorrelation);
228-
Assert.InRange(result, 0.0085, 0.0086);
230+
Assert.InRange(result, -0.0250, -0.0249);
229231
}
230232
}
231233
}

0 commit comments

Comments
 (0)