From: Cristy Date: Wed, 14 Dec 2016 21:12:13 +0000 (-0500) Subject: Lazily evaluate the image storage class and colorspace to prevent cache allocation... X-Git-Tag: 7.0.4-0~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad4722f72554f4f57547bbc82fdea9ea9af86c34;p=imagemagick Lazily evaluate the image storage class and colorspace to prevent cache allocation when pinging an image --- diff --git a/ChangeLog b/ChangeLog index 54eed0fef..21a6dfbd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-12-14 7.0.4-0 Cristy + * Lazily evaluate the image storage class and colorspace to prevent cache + allocation when pinging an image. + 2016-12-10 7.0.3-10 Cristy * Release ImageMagick version 7.0.3-10, GIT revision 19191:338f088:20161210. diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c index 85a57f72d..8d6eec4cd 100644 --- a/MagickCore/colorspace.c +++ b/MagickCore/colorspace.c @@ -1078,9 +1078,12 @@ MagickExport MagickBooleanType SetImageColorspace(Image *image, ImageType type; - MagickBooleanType - status; - + assert(image != (Image *) NULL); + assert(image->signature == MagickCoreSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickCoreSignature); if (image->colorspace == colorspace) return(MagickTrue); image->colorspace=colorspace; @@ -1115,9 +1118,8 @@ MagickExport MagickBooleanType SetImageColorspace(Image *image, image->chromaticity.white_point.y=0.3290; image->chromaticity.white_point.z=0.3583; } - status=SyncImagePixelCache(image,exception); image->type=type; - return(status); + return(MagickTrue); } /* diff --git a/MagickCore/image.c b/MagickCore/image.c index a07421b0e..6212171d1 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -2423,8 +2423,14 @@ MagickExport MagickBooleanType SetImageColor(Image *image, MagickExport MagickBooleanType SetImageStorageClass(Image *image, const ClassType storage_class,ExceptionInfo *exception) { + assert(image != (Image *) NULL); + assert(image->signature == MagickCoreSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickCoreSignature); image->storage_class=storage_class; - return(SyncImagePixelCache(image,exception)); + return(MagickTrue); } /*