From: cristy Date: Fri, 1 Mar 2013 00:47:47 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~4158 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d94a308cc4b42b09f5020acce05d779e24faa47;p=imagemagick --- diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 7c570f642..534301c9b 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -1210,8 +1210,8 @@ MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean, % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetImageKurtosis() returns the kurtosis and skewness of one or more -% image channels. +% GetImageKurtosis() returns the kurtosis and skewness of one or more image +% channels. % % The format of the GetImageKurtosis method is: % @@ -1288,14 +1288,18 @@ MagickExport MagickBooleanType GetImageKurtosis(const Image *image, register ssize_t i; + if (GetPixelMask(image,p) != 0) + { + p+=GetPixelChannels(image); + continue; + } for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel=GetPixelChannelChannel(image,i); PixelTrait traits=GetPixelChannelTraits(image,channel); if (traits == UndefinedPixelTrait) continue; - if (((traits & UpdatePixelTrait) == 0) || - (GetPixelMask(image,p) != 0)) + if ((traits & UpdatePixelTrait) == 0) continue; #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp critical (MagickCore_GetImageKurtosis) @@ -1651,6 +1655,8 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, double standard_deviation; + if (channel_statistics[i].standard_deviation == 0.0) + continue; standard_deviation=PerceptibleReciprocal( channel_statistics[i].standard_deviation); channel_statistics[i].skewness=(channel_statistics[i].sum_cubed-3.0* diff --git a/MagickCore/transform.c b/MagickCore/transform.c index 3671a5ae8..0aa87fac4 100644 --- a/MagickCore/transform.c +++ b/MagickCore/transform.c @@ -591,6 +591,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, if (crop_image == (Image *) NULL) return((Image *) NULL); crop_image->background_color.alpha=(Quantum) TransparentAlpha; + crop_image->alpha_trait=BlendPixelTrait; (void) SetImageBackgroundColor(crop_image,exception); crop_image->page=bounding_box; crop_image->page.x=(-1); @@ -2510,6 +2511,7 @@ MagickExport Image *TrimImage(const Image *image,ExceptionInfo *exception) if (crop_image == (Image *) NULL) return((Image *) NULL); crop_image->background_color.alpha=(Quantum) TransparentAlpha; + crop_image->alpha_trait=BlendPixelTrait; (void) SetImageBackgroundColor(crop_image,exception); crop_image->page=image->page; crop_image->page.x=(-1);