Commit 3894eff1a for imagemagick.org
commit 3894eff1aa434bc5a9e281a1d830173b6a9392f9
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sat May 30 19:22:40 2026 -0400
change sign
diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c
index 2714153d3..a50fef499 100644
--- a/MagickCore/statistic.c
+++ b/MagickCore/statistic.c
@@ -1799,7 +1799,7 @@ MagickExport ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
for (j=0; j < MaximumNumberOfImageMoments; j++)
{
double x = moments[channel].invariant[j];
- double alpha = (x > 0.0 ? 1.0 : (x < 0.0 ? -1.0 : 0.0))*
+ double alpha = -(x > 0.0 ? 1.0 : (x < 0.0 ? -1.0 : 0.0))*
log10(fabs(x)+MagickEpsilon);
if (alpha < mn)
@@ -1811,7 +1811,7 @@ MagickExport ChannelPerceptualHash *GetImagePerceptualHash(const Image *image,
for (j=0; j < MaximumNumberOfImageMoments; j++)
{
double x = moments[channel].invariant[j];
- double alpha = (x > 0.0 ? 1.0 : (x < 0.0 ? -1.0 : 0.0))*
+ double alpha = -(x > 0.0 ? 1.0 : (x < 0.0 ? -1.0 : 0.0))*
log10(fabs(x)+MagickEpsilon);
double scaled = 255.0*(alpha-mn)*MagickSafeReciprocal(mx-mn);
perceptual_hash[channel].phash[i][j]=MagickMin(MagickMax(scaled,0.0),