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

index 5a9e9e45aca24a287adbcc87e532399589c954f4..ac4c6fde974bdec2aed344bcfafedc4396d8b7d7 100644 (file)
@@ -1984,12 +1984,12 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
         channel_statistics[channel].sum_fourth_power+=(double) p[i]*p[i]*p[i]*
           p[i];
         channel_statistics[channel].area++;
-        histogram[GetPixelChannels(image)*ScaleQuantumToMap(
-          ClampToQuantum((double) p[i]))+channel]++;
         if ((double) p[i] < channel_statistics[CompositePixelChannel].minima)
           channel_statistics[CompositePixelChannel].minima=(double) p[i];
         if ((double) p[i] > channel_statistics[CompositePixelChannel].maxima)
           channel_statistics[CompositePixelChannel].maxima=(double) p[i];
+        histogram[GetPixelChannels(image)*ScaleQuantumToMap(
+          ClampToQuantum((double) p[i]))+i]++;
         channel_statistics[CompositePixelChannel].sum+=(double) p[i];
         channel_statistics[CompositePixelChannel].sum_squared+=(double)
           p[i]*p[i];