From: cristy Date: Thu, 7 Jun 2012 11:09:49 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5478 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2729a440ea51d1e8ad8a4b9dcc4946bc7168ff1e;p=imagemagick --- diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 15d1d8d94..f87c16611 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -1432,6 +1432,7 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima, *image_view; MagickBooleanType + initialize, status; ssize_t @@ -1442,11 +1443,12 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima, if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); status=MagickTrue; - *maxima=(-MagickHuge); - *minima=MagickHuge; + initialize=MagickTrue; + *maxima=0.0; + *minima=0.0; image_view=AcquireVirtualCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) - #pragma omp parallel for schedule(static) shared(status) \ + #pragma omp parallel for schedule(static) shared(status,initialize) \ dynamic_number_threads(image,image->columns,image->rows,1) #endif for (y=0; y < (ssize_t) image->rows; y++) @@ -1493,10 +1495,19 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima, #pragma omp critical (MagickCore_GetImageRange) #endif { - if ((double) p[i] < *minima) - *minima=(double) p[i]; - if ((double) p[i] > *maxima) - *maxima=(double) p[i]; + if (initialize != MagickFalse) + { + *minima=(double) p[i]; + *maxima=(double) p[i]; + initialize=MagickFalse; + } + else + { + if ((double) p[i] < *minima) + *minima=(double) p[i]; + if ((double) p[i] > *maxima) + *maxima=(double) p[i]; + } } } p+=GetPixelChannels(image); @@ -1575,6 +1586,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, area; MagickStatusType + initialize, status; QuantumAny @@ -1603,9 +1615,10 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, for (i=0; i <= (ssize_t) MaxPixelChannels; i++) { channel_statistics[i].depth=1; - channel_statistics[i].maxima=(-MagickHuge); - channel_statistics[i].minima=MagickHuge; + channel_statistics[i].maxima=0.0; + channel_statistics[i].minima=0.0; } + initialize=MagickTrue; for (y=0; y < (ssize_t) image->rows; y++) { register const Quantum @@ -1652,10 +1665,19 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, continue; } } - if ((double) p[i] < channel_statistics[channel].minima) - channel_statistics[channel].minima=(double) p[i]; - if ((double) p[i] > channel_statistics[channel].maxima) - channel_statistics[channel].maxima=(double) p[i]; + if (initialize != MagickFalse) + { + channel_statistics[channel].minima=(double) p[i]; + channel_statistics[channel].maxima=(double) p[i]; + initialize=MagickFalse; + } + else + { + if ((double) p[i] < channel_statistics[channel].minima) + channel_statistics[channel].minima=(double) p[i]; + if ((double) p[i] > channel_statistics[channel].maxima) + channel_statistics[channel].maxima=(double) p[i]; + } channel_statistics[channel].sum+=p[i]; channel_statistics[channel].sum_squared+=(double) p[i]*p[i]; channel_statistics[channel].sum_cubed+=(double) p[i]*p[i]*p[i]; diff --git a/MagickCore/version.h b/MagickCore/version.h index b4f47e657..cd1725e63 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -34,7 +34,7 @@ extern "C" { #define MagickLibAddendum "-0" #define MagickLibInterface 7 #define MagickLibMinInterface 7 -#define MagickReleaseDate "2012-06-03" +#define MagickReleaseDate "2012-06-07" #define MagickChangeDate "20110801" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/config/ImageMagick.rdf b/config/ImageMagick.rdf index f0854c680..32ce1e417 100644 --- a/config/ImageMagick.rdf +++ b/config/ImageMagick.rdf @@ -5,7 +5,7 @@ ImageMagick ImageMagick: convert, edit, and compose images. - 2012-06-03 + 2012-06-07 ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. @@ -57,7 +57,7 @@ Examples of ImageMagick Usage shows how to use ImageMagick from the command-line stable - 2012-06-03 + 2012-06-07 7.0.0 -0 diff --git a/config/configure.xml b/config/configure.xml index 959b6bd82..4c26fe35a 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -11,7 +11,7 @@ - +