From: anthony Date: Fri, 10 Sep 2010 14:37:52 +0000 (+0000) Subject: Fix Gaussian Filter mistake (constant moved into exp()) X-Git-Tag: 7.0.1-0~8955 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8daaf7a8e3148327d53a86a008592efc97e1138;p=imagemagick Fix Gaussian Filter mistake (constant moved into exp()) --- diff --git a/magick/resize.c b/magick/resize.c index efc51a061..8791a516f 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -227,11 +227,11 @@ static MagickRealType Gaussian(const MagickRealType x, const ResizeFilter *magick_unused(resize_filter)) { /* - Unnormalized Gaussian with variance sqrt(pi)/(4*sqrt(2)): - exp(-2 x^2/sqrt(pi/2)) + exp(-2 x^2)*sqrt(2/pi)) */ - const MagickRealType alpha = -sqrt((double) (8.0/MagickPIL)); - return(exp((double) (alpha*x*x))); + //const MagickRealType alpha = sqrt((double) (2.0/MagickPIL)); + const MagickRealType alpha = 2.0/MagickSQ2PI; + return(exp(-(double)(2.0*x*x))*alpha); } static MagickRealType Hanning(const MagickRealType x,