Skip to content

Commit

Permalink
Add rm_set_user_artifact. If the "user" info option is defined, copy …
Browse files Browse the repository at this point in the history
…the value to the image's "user" artifact.
  • Loading branch information
rmagick committed Oct 27, 2008
1 parent 0317947 commit 82745b1
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion ext/RMagick/rmutil.c
@@ -1,4 +1,4 @@
/* $Id: rmutil.c,v 1.166 2008/10/22 22:27:05 rmagick Exp $ */
/* $Id: rmutil.c,v 1.167 2008/10/27 22:16:52 rmagick Exp $ */
/*============================================================================\
| Copyright (C) 2008 by Timothy P. Hunter
| Name: rmutil.c
Expand Down Expand Up @@ -3372,6 +3372,31 @@ rm_set_property(Image *image, const char *property, const char *value)
}


/*
Function: rm_set_user_artifact
Purpose: If a "user" option is present in the Info, assign its value to
a "user" artifact in each image.
*/
void rm_set_user_artifact(Image *images, Info *info)
{
#if defined(HAVE_SETIMAGEARTIFACT)
Image *image;
const char *value;

value = GetImageOption(info, "user");
if (value)
{
image = GetFirstImageInList(images);
while (image)
{
(void) SetImageArtifact(image, "user", value);
image = GetNextImageInList(image);
}
}
#endif
}


/*
Function: rm_get_optional_arguments
Purpose: Collect optional method arguments via Magick::OptionalMethodArguments
Expand Down

0 comments on commit 82745b1

Please sign in to comment.