From: Cristy Date: Mon, 27 Feb 2017 12:43:39 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.5-1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c48b5e5dc83523377085b53668d584a66d2968f4;p=imagemagick ... --- diff --git a/MagickCore/compare.c b/MagickCore/compare.c index 0e844825f..5cdbd89e7 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -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); }