]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 12 Aug 2011 13:02:19 +0000 (13:02 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 12 Aug 2011 13:02:19 +0000 (13:02 +0000)
MagickCore/cache.c
MagickCore/cache.h
MagickCore/colorspace.c
MagickCore/image.c
PerlMagick/Magick.xs

index c088e440394498be10d8d9147f85ce3cee1b69af..1f40a0331f40a3b4e77c53ef9d00ee4ede194f69 100644 (file)
@@ -5318,6 +5318,45 @@ MagickExport MagickBooleanType SyncAuthenticPixels(Image *image,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   S y n c I m a g e P i x e l C a c h e                                     %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  SyncImagePixelCache() saves the image pixels to the in-memory or disk cache.
+%  The method returns MagickTrue if the pixel region is flushed, otherwise
+%  MagickFalse.
+%
+%  The format of the SyncImagePixelCache() method is:
+%
+%      MagickBooleanType SyncImagePixelCache(Image *image,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport MagickBooleanType SyncImagePixelCache(Image *image,
+  ExceptionInfo *exception)
+{
+  CacheInfo
+    *cache_info;
+
+  assert(image != (Image *) NULL);
+  assert(exception != (ExceptionInfo *) NULL);
+  cache_info=(CacheInfo *) GetImagePixelCache(image,MagickTrue,exception);
+  return(cache_info == (CacheInfo *) NULL ? MagickFalse : MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   W r i t e P i x e l C a c h e M e t a c o n t e n t                       %
 %                                                                             %
 %                                                                             %
index 2b8ed2b77732c5df1f7018a4dafadd06da2cb73e..22b9fce352310813e177fd878e30d76a3d35fafb 100644 (file)
@@ -45,7 +45,8 @@ extern MagickExport MagickBooleanType
     ExceptionInfo *),
   PersistPixelCache(Image *,const char *,const MagickBooleanType,
     MagickOffsetType *,ExceptionInfo *),
-  SyncAuthenticPixels(Image *,ExceptionInfo *);
+  SyncAuthenticPixels(Image *,ExceptionInfo *),
+  SyncImagePixelCache(Image *,ExceptionInfo *);
 
 extern MagickExport MagickSizeType
   GetImageExtent(const Image *);
index 44ee76b8da0c5d30c49b267b0d909bddb7095346..ded7e8a4568a939230c6c2d95c4dfbe5a93caf7c 100644 (file)
@@ -1193,7 +1193,7 @@ MagickExport MagickBooleanType SetImageColorspace(Image *image,
   const ColorspaceType colorspace,ExceptionInfo *exception)
 {
   image->colorspace=colorspace;
-  return(MagickTrue);
+  return(SyncImagePixelCache(image,exception));
 }
 \f
 /*
index c9faeb42793cb9d8028e42ee4023489aced6b2ad..f926196b3ee9fd41e7c8e271a66f559181bb0081 100644 (file)
@@ -2656,7 +2656,9 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
     case UndefinedAlphaChannel:
       break;
   }
-  return(status);
+  if (status == MagickFalse)
+    return(status);
+  return(SyncImagePixelCache(image,exception));
 }
 \f
 /*
@@ -2867,7 +2869,7 @@ MagickExport MagickBooleanType SetImageStorageClass(Image *image,
   const ClassType storage_class,ExceptionInfo *exception)
 {
   image->storage_class=storage_class;
-  return(MagickTrue);
+  return(SyncImagePixelCache(image,exception));
 }
 \f
 /*
@@ -2957,7 +2959,7 @@ MagickExport MagickBooleanType SetImageExtent(Image *image,const size_t columns,
     return(MagickFalse);
   image->columns=columns;
   image->rows=rows;
-  return(MagickTrue);
+  return(SyncImagePixelCache(image,exception));
 }
 \f
 /*
index fe0dd937e401877bbf42dfadf1ec9edb55ab8f91..03b29ed70d2d39dcd8bbaf47e992e19539a3a2eb 100644 (file)
@@ -10459,7 +10459,7 @@ Mogrify(ref,...)
           if (attribute_flag[0] == 0)
             argument_list[0].string_reference=(char *) NULL;
           (void) ColorDecisionListImage(image,
-            argument_list[0].string_reference);
+            argument_list[0].string_reference,exception);
           break;
         }
         case 127:  /* AutoGamma */