From 8d17cbecf9e6b973639731a26fe053c0c85f417d Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 12 Feb 2017 12:14:42 -0500 Subject: [PATCH] ... --- MagickCore/statistic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 27660ea16..1ff30f373 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -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) { -- 2.40.0