]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Mon, 27 Feb 2017 12:43:39 +0000 (07:43 -0500)
committerCristy <urban-warrior@imagemagick.org>
Mon, 27 Feb 2017 12:43:39 +0000 (07:43 -0500)
MagickCore/compare.c

index 0e844825f131bdee2f8a69d77aa9b2517c952924..5cdbd89e738546edcae574d681bacfdb5784a824 100644 (file)
@@ -1212,8 +1212,13 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
 
   status=GetMeanSquaredDistortion(image,reconstruct_image,distortion,exception);
   for (i=0; i <= MaxPixelChannels; i++)
-    if (fabs(distortion[i]) >= MagickEpsilon)
-      distortion[i]=20.0*MagickLog10((double) 1.0/sqrt(distortion[i]));
+  {
+    double
+      gamma;
+
+    gamma=PerceptibleReciprocal(sqrt(distortion[i]));
+    distortion[i]=20.0*MagickLog10(gamma);
+  }
   return(status);
 }