% 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 %
(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
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->artifacts == (void *) NULL)
return(MagickFalse);
return(DeleteNodeFromSplayTree((SplayTreeInfo *) image->artifacts,artifact));
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->artifacts != (void *) NULL)
image->artifacts=(void *) DestroySplayTree((SplayTreeInfo *)
image->artifacts);
}
if (image->artifacts != (void *) NULL)
{
- p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
- image->artifacts,artifact);
+ p=(const char *) GetValueFromSplayTree((SplayTreeInfo *) image->artifacts,
+ artifact);
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) &&
- (image->image_info->options != (void *) NULL) )
+ if ((image->image_info != (ImageInfo *) NULL) &&
+ (image->image_info->options != (void *) NULL))
p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
- image->image_info->options,artifact);
+ image->image_info->options,artifact);
return(p);
}
\f
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->artifacts == (void *) NULL)
return((char *) NULL);
return((char *) GetNextKeyInSplayTree((SplayTreeInfo *) image->artifacts));
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->artifacts == (void *) NULL)
return((char *) NULL);
value=(char *) RemoveNodeFromSplayTree((SplayTreeInfo *) image->artifacts,
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->artifacts == (void *) NULL)
return;
ResetSplayTreeIterator((SplayTreeInfo *) image->artifacts);
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% SetImageArtifact() associates makes a copy of the given string value
+% SetImageArtifact() associates makes a copy of the given string arguments
% and inserts it into the artifact tree of the given image.
%
% The format of the SetImageArtifact method is:
%
% o image: the image.
%
-% o artifact: the image artifact.
+% o artifact: the image artifact key.
%
-% o values: the image artifact values.
+% o value: the image artifact value.
%
*/
MagickExport MagickBooleanType SetImageArtifact(Image *image,
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
- image->filename);
-
- /* Create tree if needed - specify how key,values are to be freed */
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+ /*
+ Create tree if needed - specify how key,values are to be freed.
+ */
if (image->artifacts == (void *) NULL)
- image->artifacts=NewSplayTree(CompareSplayTreeString,
- RelinquishMagickMemory,RelinquishMagickMemory);
-
- /* Delete artifact if NULL -- empty string values are valid! */
+ image->artifacts=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory,
+ RelinquishMagickMemory);
+ /*
+ Delete artifact if NULL -- empty string values are valid!,
+ */
if (value == (const char *) NULL)
return(DeleteImageArtifact(image,artifact));
-
- /* add artifact to splay-tree */
+ /*
+ Add artifact to splay-tree.
+ */
status=AddValueToSplayTree((SplayTreeInfo *) image->artifacts,
ConstantString(artifact),ConstantString(value));
return(status);