]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 1 Mar 2013 00:47:47 +0000 (00:47 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 1 Mar 2013 00:47:47 +0000 (00:47 +0000)
MagickCore/statistic.c
MagickCore/transform.c

index 7c570f64288fcc1d3a57d901ead5d203852693cb..534301c9bad23863c8f5e7873e97b126a0c7fd5c 100644 (file)
@@ -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*
index 3671a5ae8669f000ee17b881ae8c5cc3865a9aa0..0aa87fac4bc77d90725cb1ff7b1e98de08cc4a8f 100644 (file)
@@ -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);