]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 12 Feb 2017 17:14:42 +0000 (12:14 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 12 Feb 2017 17:14:42 +0000 (12:14 -0500)
MagickCore/statistic.c

index 27660ea162cfcc4db4343f45fc86d4ed694c7bb6..1ff30f3730ba870060b95200dcb162bd6fe00b9d 100644 (file)
@@ -1410,6 +1410,8 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image,
         PixelTrait traits=GetPixelChannelTraits(image,channel);
         if (traits == UndefinedPixelTrait)
           continue;
+        if ((traits & UpdatePixelTrait) == 0)
+          continue;
         M00[channel]+=QuantumScale*p[i];
         M00[MaxPixelChannels]+=QuantumScale*p[i];
         M10[channel]+=x*QuantumScale*p[i];
@@ -1466,6 +1468,8 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image,
         PixelTrait traits=GetPixelChannelTraits(image,channel);
         if (traits == UndefinedPixelTrait)
           continue;
+        if ((traits & UpdatePixelTrait) == 0)
+          continue;
         M11[channel]+=(x-centroid[channel].x)*(y-centroid[channel].y)*
           QuantumScale*p[i];
         M11[MaxPixelChannels]+=(x-centroid[channel].x)*(y-centroid[channel].y)*
@@ -1804,6 +1808,8 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima,
         PixelTrait traits=GetPixelChannelTraits(image,channel);
         if (traits == UndefinedPixelTrait)
           continue;
+        if ((traits & UpdatePixelTrait) == 0)
+          continue;
         if (row_initialize != MagickFalse)
           {
             row_minima=(double) p[i];
@@ -1958,7 +1964,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
       {
         PixelChannel channel=GetPixelChannelChannel(image,i);
         PixelTrait traits=GetPixelChannelTraits(image,channel);
-        if (traits == UndefinedPixelTrait)
+        if (traits  == UndefinedPixelTrait)
           continue;
         if (channel_statistics[channel].depth != MAGICKCORE_QUANTUM_DEPTH)
           {