]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/artifact.c
(no commit message)
[imagemagick] / MagickCore / artifact.c
index 05c603118121d744046ed33aef040bf705fbd492..b51c7114702ed3403e0ddedfe57f8471dc839b33 100644 (file)
 %                         MagickCore Artifact Methods                         %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 March 2000                                  %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -112,8 +112,12 @@ MagickExport MagickBooleanType CloneImageArtifacts(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       clone_image->filename);
   if (clone_image->artifacts != (void *) NULL)
-    image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts,
-      (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+    {
+      if (image->artifacts != (void *) NULL)
+        DestroyImageArtifacts(image);
+      image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts,
+        (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+    }
   return(MagickTrue);
 }
 \f
@@ -291,15 +295,7 @@ MagickExport const char *GetImageArtifact(const Image *image,
       if (p != (const char *) NULL)
         return(p);
     }
-  /*
-    Programmer notes:
-
-    CLI IMv7: if no per-image artifact - look for a global option instead CLI
-    IMv6: global options are copied into per-image artifacts In all other
-    cases, if image is not part of an image_info image list this pointer
-    should be NULL, an no global image options are available.
-  */
-  if ((image->image_info != (ImageInfo *)NULL) &&
+  if ((image->image_info != (ImageInfo *) NULL) &&
       (image->image_info->options != (void *) NULL))
     p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
       image->image_info->options,artifact);