]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/statistic.c
(no commit message)
[imagemagick] / MagickCore / statistic.c
index e6fb94ee1715bbe3eeb377f42f551d2d88345df4..3ccb07cefed5d0044a49deb647b09c2b433c3712 100644 (file)
@@ -857,6 +857,8 @@ MagickExport MagickBooleanType EvaluateImage(Image *image,
         traits=GetPixelChannelMapTraits(image,channel);
         if (traits == UndefinedPixelTrait)
           continue;
+        if ((traits & CopyPixelTrait) != 0)
+          continue;
         q[i]=ClampToQuantum(ApplyEvaluateOperator(random_info[id],q[i],op,
           value));
       }
@@ -2288,6 +2290,12 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
       register ssize_t
         i;
 
+      if (GetPixelMask(image,p) != 0)
+        {
+          p+=GetPixelChannels(image);
+          q+=GetPixelChannels(statistic_image);
+          continue;
+        }
       for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
       {
         PixelChannel
@@ -2315,8 +2323,7 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
         if ((traits == UndefinedPixelTrait) ||
             (statistic_traits == UndefinedPixelTrait))
           continue;
-        if (((statistic_traits & CopyPixelTrait) != 0) ||
-            (GetPixelMask(image,p) != 0))
+        if ((statistic_traits & CopyPixelTrait) != 0)
           {
             SetPixelChannel(statistic_image,channel,p[center+i],q);
             continue;