]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/operation.c
(no commit message)
[imagemagick] / MagickWand / operation.c
index 15791bec5926c77843cc156bc274aba69a5dcb37..253fe10c95dfe014b5cf6873ca627b8b25855f11 100644 (file)
@@ -17,7 +17,7 @@
 %                               September 2011                                %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2013 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  %
@@ -62,7 +62,7 @@
 /*
   Define declarations.
 */
-#define USE_WAND_METHODS  0
+#define USE_WAND_METHODS  1
 #define MAX_STACK_DEPTH  32
 #define UNDEFINED_COMPRESSION_QUALITY  0UL
 
@@ -399,7 +399,7 @@ static Image *SparseColorOption(const Image *image,
 %        arg2 is currently only used by "-limit"
 %
 */
-WandExport void CLISettingOptionInfo(MagickCLI *cli_wand,
+WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand,
      const char *option,const char *arg1, const char *arg2)
 {
   ssize_t
@@ -949,13 +949,24 @@ interpret Percent Escapes in Arguments, At least not yet */
     }
     case 'i':
     {
+      if (LocaleCompare("intensity",option+1) == 0)
+        {
+          arg1 = ArgOption("undefined");
+          parse = ParseCommandOption(MagickPixelIntensityOptions,MagickFalse,
+            arg1);
+          if (parse < 0)
+            CLIWandExceptArgBreak(OptionError,"UnrecognizedIntensityType",
+              option,arg1);
+          (void) SetImageOption(_image_info,option+1,arg1);
+          break;
+        }
       if (LocaleCompare("intent",option+1) == 0)
         {
           /* Only used by coders: MIFF, MPC, BMP, PNG
              and for image profile call to AcquireTransformThreadSet()
              SyncImageSettings() used to set per-image attribute.
           */
-          arg1 = ArgOption("indefined");
+          arg1 = ArgOption("undefined");
           parse = ParseCommandOption(MagickIntentOptions,MagickFalse,arg1);
           if (parse < 0)
             CLIWandExceptArgBreak(OptionError,"UnrecognizedIntentType",
@@ -1310,8 +1321,8 @@ interpret Percent Escapes in Arguments, At least not yet */
           if (IfMagickFalse(IsGeometry(arg1)))
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           SetRandomSecretKey(
-               IfSetOption ? (const unsigned long) StringToUnsignedLong(arg1)
-                           : (const unsigned long) time((time_t *) NULL) );
+               IfSetOption ? (unsigned long) StringToUnsignedLong(arg1)
+                           : (unsigned long) time((time_t *) NULL) );
           break;
         }
       if (LocaleCompare("size",option+1) == 0)
@@ -1603,12 +1614,11 @@ interpret Percent Escapes in Arguments, At least not yet */
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  WandSimpleOperatorImages() andSimpleOperatorImagespplys one simple image operation given to all
-%  the images in the CLI wand,  with the settings that was previously saved in
-%  the CLI wand.
+%  CLISimpleOperatorImages() applys one simple image operation given to all
+%  the images in the CLI wand, using any per-image or global settings that was
+%  previously saved in the CLI wand.
 %
-%  It is assumed that any per-image settings are up-to-date with respect to
-%  extra settings that were already saved in the wand.
+%  It is assumed that any such settings are up-to-date.
 %
 %  The format of the WandSimpleOperatorImages method is:
 %
@@ -1626,8 +1636,8 @@ interpret Percent Escapes in Arguments, At least not yet */
 */
 
 /*
-  Internal subrountine to apply one simple image operation to the current
-  image pointed to by the CLI wand.
+  CLISimpleOperatorImage() is an Internal subrountine to apply one simple
+  image operation to the current image pointed to by the CLI wand.
 
   The image in the list may be modified in three different ways...
     * directly modified (EG: -negate, -gamma, -level, -annotate, -draw),
@@ -1642,7 +1652,7 @@ interpret Percent Escapes in Arguments, At least not yet */
   also change.  GetFirstImageInList() should be used by caller if they wish
   return the Image pointer to the first image in list.
 */
-static void CLISimpleOperatorImage(MagickCLI *cli_wand,
+static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
   const char *option, const char *arg1n, const char *arg2n)
 {
   Image *
@@ -1769,7 +1779,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
 
           SetGeometryInfo(&geometry_info);
           flags=ParseGeometry(arg1,&geometry_info);
-          if ((flags & RhoValue) == 0)
+          if (flags == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           if ((flags & SigmaValue) == 0)
             geometry_info.sigma=geometry_info.rho;
@@ -1801,49 +1811,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
         }
       if (LocaleCompare("auto-orient",option+1) == 0)
         {
-          /* This should probably be a MagickCore function */
-          switch (_image->orientation)
-          {
-            case TopRightOrientation:
-            {
-              new_image=FlopImage(_image,_exception);
-              break;
-            }
-            case BottomRightOrientation:
-            {
-              new_image=RotateImage(_image,180.0,_exception);
-              break;
-            }
-            case BottomLeftOrientation:
-            {
-              new_image=FlipImage(_image,_exception);
-              break;
-            }
-            case LeftTopOrientation:
-            {
-              new_image=TransposeImage(_image,_exception);
-              break;
-            }
-            case RightTopOrientation:
-            {
-              new_image=RotateImage(_image,90.0,_exception);
-              break;
-            }
-            case RightBottomOrientation:
-            {
-              new_image=TransverseImage(_image,_exception);
-              break;
-            }
-            case LeftBottomOrientation:
-            {
-              new_image=RotateImage(_image,270.0,_exception);
-              break;
-            }
-            default:
-              break;
-          }
-          if (new_image != (Image *) NULL)
-            new_image->orientation=TopLeftOrientation;
+          new_image=AutoOrientImage(_image,_image->orientation,_exception);
           break;
         }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
@@ -1950,8 +1918,8 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
             geometry_info.sigma=1.0;
           if ((flags & XiValue) == 0)
             geometry_info.xi=1.0;
-          new_image=CharcoalImage(_image,geometry_info.rho,
-            geometry_info.sigma,_exception);
+          new_image=CharcoalImage(_image,geometry_info.rho,geometry_info.sigma,
+            _exception);
           break;
         }
       if (LocaleCompare("chop",option+1) == 0)
@@ -2014,7 +1982,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
               break;
             for (x=0; x < (ssize_t) mask_image->columns; x++)
             {
-              if (IfMagickFalse(mask_image->alpha_trait))
+              if (mask_image->alpha_trait != BlendPixelTrait)
                 SetPixelAlpha(mask_image,GetPixelIntensity(mask_image,q),q);
               SetPixelRed(mask_image,GetPixelAlpha(mask_image,q),q);
               SetPixelGreen(mask_image,GetPixelAlpha(mask_image,q),q);
@@ -2084,7 +2052,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
              That seems to be a little strange!
           */
           (void) TransformImageColorspace(_image,
-                    IfNormalOp ? _image_info->colorspace : RGBColorspace,
+                    IfNormalOp ? _image_info->colorspace : sRGBColorspace,
                     _exception);
           break;
         }
@@ -2255,10 +2223,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
           flags=ParseGeometry(arg1,&geometry_info);
           if ((flags & (RhoValue|SigmaValue)) == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
-          if ((flags & SigmaValue) == 0)
-            geometry_info.sigma=1.0;
-          new_image=EdgeImage(_image,geometry_info.rho,geometry_info.sigma,
-               _exception);
+          new_image=EdgeImage(_image,geometry_info.rho,_exception);
           break;
         }
       if (LocaleCompare("emboss",option+1) == 0)
@@ -2482,6 +2447,19 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
               _image->filter,_exception);
           break;
         }
+      if (LocaleCompare("distort",option+1) == 0)
+        {
+          parse = ParseCommandOption(MagickPixelIntensityOptions,
+            MagickFalse,arg1);
+          if ( parse < 0 )
+             CLIWandExceptArgBreak(OptionError,"UnrecognizedIntensityMethod",
+               option,arg1);
+          _image->intensity = (PixelIntensityMethod) parse;
+          (void) TransformImageColorspace(_image,
+                    IfNormalOp ? _image_info->colorspace : GRAYColorspace,
+                    _exception);
+          break;
+        }
       CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option);
     }
     case 'i':
@@ -2842,6 +2820,12 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
                _exception);
           break;
         }
+      if (LocaleCompare("perceptible",option+1) == 0)
+        {
+          (void) PerceptibleImage(_image,StringToDouble(arg1,(char **) NULL),
+            _exception);
+          break;
+        }
       if (LocaleCompare("polaroid",option+1) == 0)
         {
           const char
@@ -3114,42 +3098,6 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
                  (double) QuantumRange+1.0),_exception);
           break;
         }
-      if (LocaleCompare("set",option+1) == 0)
-        {
-          /* Note: arguments do not have percent escapes expanded */
-          char
-            *value;
-
-          if (IfPlusOp) {
-              if (LocaleNCompare(arg1,"registry:",9) == 0)
-                (void) DeleteImageRegistry(arg1+9);
-              else
-                if (LocaleNCompare(arg1,"option:",7) == 0)
-                  {
-                    (void) DeleteImageOption(_image_info,arg1+7);
-                    (void) DeleteImageArtifact(_image,arg1+7);
-                  }
-                else
-                  (void) DeleteImageProperty(_image,arg1);
-              break;
-            }
-          value=InterpretImageProperties(_image_info,_image,arg2,_exception);
-          if (value == (char *) NULL)
-            CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure",
-                  option);
-          if (LocaleNCompare(arg1,"registry:",9) == 0)
-            (void) SetImageRegistry(StringRegistryType,arg1+9,value,_exception);
-          else
-            if (LocaleNCompare(arg1,"option:",7) == 0)
-              {
-                (void) SetImageOption(_image_info,arg1+7,value);
-                (void) SetImageArtifact(_image,arg1+7,value);
-              }
-            else
-              (void) SetImageProperty(_image,arg1,value,_exception);
-          value=DestroyString(value);
-          break;
-        }
       if (LocaleCompare("shade",option+1) == 0)
         {
           flags=ParseGeometry(arg1,&geometry_info);
@@ -3474,7 +3422,7 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
   if (new_image != (Image *) NULL)
     ReplaceImageInListReturnLast(&_image,new_image);
 
-  return;
+  return(MagickTrue);
 #undef _image_info
 #undef _draw_info
 #undef _quantize_info
@@ -3486,12 +3434,14 @@ static void CLISimpleOperatorImage(MagickCLI *cli_wand,
 #undef plus_alt_op
 }
 
-WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand,
-  const char *option, const char *arg1, const char *arg2)
+WandPrivate MagickBooleanType CLISimpleOperatorImages(MagickCLI *cli_wand,
+  const char *option,const char *arg1,const char *arg2)
 {
+#if !USE_WAND_METHODS
   size_t
     n,
     i;
+#endif
 
   assert(cli_wand != (MagickCLI *) NULL);
   assert(cli_wand->signature == WandSignature);
@@ -3520,7 +3470,7 @@ WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand,
     CLISimpleOperatorImage(cli_wand, option, arg1, arg2);
   MagickResetIterator(&cli_wand->wand);
 #endif
-  return;
+  return(MagickTrue);
 }
 \f
 /*
@@ -3536,12 +3486,13 @@ WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand,
 %
 %  CLIListOperatorImages() applies a single operation that is apply to the
 %  entire image list as a whole. The result is often a complete replacment
-%  of the image list with a completely new list, or just a single image.
+%  of the image list with a completely new list, or with just a single image
+%  result.
 %
 %  The format of the MogrifyImage method is:
 %
-%    void CLIListOperatorImages(MagickCLI *cli_wand,
-%        const char *option, const char *arg1, const char *arg2)
+%    MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
+%      const char *option,const char *arg1,const char *arg2)
 %
 %  A description of each parameter follows:
 %
@@ -3553,18 +3504,21 @@ WandExport void CLISimpleOperatorImages(MagickCLI *cli_wand,
 %        arg2 is currently not used
 %
 */
-WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
-     const char *option,const char *arg1n, const char *arg2n)
+WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
+  const char *option,const char *arg1n,const char *arg2n)
 {
-  ssize_t
-    parse;
+  const char    /* For percent escape interpretImageProperties() */
+    *arg1,
+    *arg2;
 
   Image
     *new_images;
 
-  const char    /* For percent escape interpretImageProperties() */
-    *arg1,
-    *arg2;
+  MagickStatusType
+    status;
+
+  ssize_t
+    parse;
 
 #define _image_info     (cli_wand->wand.image_info)
 #define _images         (cli_wand->wand.images)
@@ -3614,7 +3568,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
     "CLIListOperatorImages: \"%s\" \"%s\" \"%s\"\n",option,arg1,arg2);
 #endif
 
-
+  status=MagickTrue;
   new_images=NewImageList();
 
   switch (*(option+1))
@@ -3668,6 +3622,9 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
         {
           /* FUTURE - this may be replaced by a 'channel' method */
           parse = ParseCommandOption(MagickColorspaceOptions,MagickFalse,arg1);
+          if (parse < 0)
+            CLIWandExceptArgBreak(OptionError,"UnrecognizedColorspace",option,
+              arg1);
           new_images=CombineImages(_images,(ColorspaceType) parse,_exception);
           break;
         }
@@ -3718,32 +3675,44 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
           /* FUTURE - this should not be here! - should be part of -geometry */
           (void) TransformImage(&source_image,(char *) NULL,
             source_image->geometry,_exception);
-
           SetGeometry(source_image,&geometry);
           (void) ParseAbsoluteGeometry(source_image->geometry,&geometry);
           GravityAdjustGeometry(new_images->columns,new_images->rows,
-               new_images->gravity, &geometry);
-
+            new_images->gravity, &geometry);
           mask_image=RemoveFirstImageFromList(&_images);
           if (mask_image != (Image *) NULL)
-            { /* handle a third write mask image */
+            {
               if ((compose == DisplaceCompositeOp) ||
-                  (compose == DistortCompositeOp)) {
-                /* Merge Y displacement into X displace/distort map. */
-                (void) CompositeImage(source_image,mask_image,
+                  (compose == DistortCompositeOp))
+                status&=CompositeImage(source_image,mask_image,
                   CopyGreenCompositeOp,MagickTrue,0,0,_exception);
-                mask_image=DestroyImage(mask_image);
-              }
-              else {
-                /* Set a blending mask for the composition.  */
-                (void) NegateImage(mask_image,MagickFalse,_exception);
-                (void) SetImageMask(source_image,mask_image,_exception);
-                mask_image=DestroyImage(mask_image);
-              }
+              else
+                {
+                  Image
+                    *image;
+
+                  RectangleInfo
+                    source_geometry;
+
+                  source_geometry.width=mask_image->columns;
+                  source_geometry.height=mask_image->rows;
+                  source_geometry.x=(-geometry.x);
+                  source_geometry.y=(-geometry.y);
+                  geometry.x=0;
+                  geometry.y=0;
+                  image=ExtentImage(source_image,&source_geometry,_exception);
+                  if (image != (Image *) NULL)
+                    {
+                      source_image=DestroyImage(source_image);
+                      source_image=image;
+                    }
+                  status&=CompositeImage(source_image,mask_image,
+                    IntensityCompositeOp,MagickTrue,0,0,_exception);
+                }
+              mask_image=DestroyImage(mask_image);
             }
-          (void) CompositeImage(new_images,source_image,compose,clip_to_self,
+          status&=CompositeImage(new_images,source_image,compose,clip_to_self,
             geometry.x,geometry.y,_exception);
-          (void) SetImageMask(new_images,(Image *) NULL,_exception);
           source_image=DestroyImage(source_image);
           break;
         }
@@ -4080,6 +4049,22 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
     }
     case 'p':
     {
+      if (LocaleCompare("poly",option+1) == 0)
+        {
+          double
+            *args;
+
+          ssize_t
+            count;
+
+          /* convert argument string into an array of doubles */
+          args = StringToArrayOfDoubles(arg2,&count,_exception);
+          if (args == (double *)NULL )
+            CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2);
+          new_images=PolynomialImage(_images,count >> 1,args,_exception);
+          args=(double *) RelinquishMagickMemory(args);
+          break;
+        }
       if (LocaleCompare("print",option+1) == 0)
         {
           (void) FormatLocaleFile(stdout,"%s",arg1);
@@ -4212,7 +4197,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
             metric=(MetricType) ParseCommandOption(MagickMetricOptions,
               MagickFalse,value);
 
-          new_images=SimilarityImage(base_image,compare_image,metric,
+          new_images=SimilarityImage(base_image,compare_image,metric,0.0,
                &offset,&similarity,_exception);
 
           if ( new_images != (Image *)NULL ) {
@@ -4248,8 +4233,8 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
           index,
           swap_index;
 
-        index=-1;
-        swap_index=-2;
+        index=(-1);
+        swap_index=(-2);
         if (IfNormalOp) {
           GeometryInfo
             geometry_info;
@@ -4259,7 +4244,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
 
           swap_index=(-1);
           flags=ParseGeometry(arg1,&geometry_info);
-          if ((flags & RhoValue) != 0)
+          if ((flags & RhoValue) == 0)
             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1);
           index=(ssize_t) geometry_info.rho;
           if ((flags & SigmaValue) != 0)
@@ -4295,10 +4280,10 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
 
   /* if new image list generated, replace existing image list */
   if (new_images == (Image *) NULL)
-    return;
+    return(status);
   _images=DestroyImageList(_images);
   _images=GetFirstImageInList(new_images);
-  return;
+  return(status);
 
 #undef _image_info
 #undef _images
@@ -4338,7 +4323,7 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
 %
 %  A description of each parameter follows:
 %
-%    o cli_wand: the main CLI Wand to use.
+%    o cli_wand: the main CLI Wand to use. (sometimes not required)
 %
 %    o option: The special option (with any switch char) to process
 %
@@ -4346,8 +4331,8 @@ WandExport void CLIListOperatorImages(MagickCLI *cli_wand,
 %                   Currently arg2 is not used.
 %
 */
-WandExport void CLINoImageOperator(MagickCLI *cli_wand,
-  const char *option, const char *arg1, const char *magick_unused(arg2))
+WandPrivate void CLINoImageOperator(MagickCLI *cli_wand,
+  const char *option,const char *arg1,const char *arg2)
 {
 #if 0
   const char    /* For percent escape interpretImageProperties() */
@@ -4404,11 +4389,13 @@ WandExport void CLINoImageOperator(MagickCLI *cli_wand,
     /*
       No-op options  (ignore these)
     */
-    if (LocaleCompare("noop",option+1) == 0)   /* no argument */
+    if (LocaleCompare("noop",option+1) == 0)   /* zero argument */
       break;
     if (LocaleCompare("sans",option+1) == 0)   /* one argument */
       break;
-    if (LocaleCompare("sans0",option+1) == 0)  /* no argument */
+    if (LocaleCompare("sans0",option+1) == 0)  /* zero argument */
+      break;
+    if (LocaleCompare("sans1",option+1) == 0)  /* one argument */
       break;
     if (LocaleCompare("sans2",option+1) == 0)  /* two arguments */
       break;
@@ -4612,6 +4599,88 @@ WandExport void CLINoImageOperator(MagickCLI *cli_wand,
 
       break;
     }
+    if (LocaleCompare("set",option+1) == 0)
+      {
+        /* Note: arguments are not percent escapes expanded yet */
+        /* Some settings are applied to each image in memory in turn.
+           While others only need to be applied once globally.
+        */
+        char
+          *value;
+
+        if (LocaleNCompare(arg1,"registry:",9) == 0)
+          {
+            if (IfPlusOp)
+              {
+                (void) DeleteImageRegistry(arg1+9);
+                break;
+              }
+            value=InterpretImageProperties(_image_info,_images,arg2,_exception);
+            if (value == (char *) NULL)
+              CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure",
+                    option);
+            (void) SetImageRegistry(StringRegistryType,arg1+9,value,_exception);
+            value=DestroyString(value);
+            break;
+          }
+        if (LocaleNCompare(arg1,"option:",7) == 0)
+          {
+            /* delete equivelent artifact from all images (if any) */
+            MagickResetIterator(&cli_wand->wand);
+            while ( IfMagickTrue(MagickNextImage(&cli_wand->wand)) )
+              (void) DeleteImageArtifact(_images,arg1+7);
+            MagickResetIterator(&cli_wand->wand);
+            /* now set/delete the global option as needed */
+            if (IfPlusOp) {
+              (void) DeleteImageOption(_image_info,arg1+7);
+              break;
+            }
+            value=InterpretImageProperties(_image_info,_images,arg2,_exception);
+            if (value == (char *) NULL)
+              CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure",
+                option);
+            (void) SetImageOption(_image_info,arg1+7,value);
+            value=DestroyString(value);
+            break;
+          }
+        if ( cli_wand->wand.images == (Image *) NULL )
+          CLIWandExceptArgBreak(OptionError,"NoImagesFound",option,arg1);
+        MagickResetIterator(&cli_wand->wand);
+        while ( IfMagickTrue(MagickNextImage(&cli_wand->wand)) )
+          {
+            Image
+              *next;
+
+            if (IfPlusOp) {
+              if (LocaleNCompare(arg1,"artifact:",9) == 0)
+                (void) DeleteImageArtifact(_images,arg1+9);
+              else if (LocaleNCompare(arg1,"property:",9) == 0)
+                (void) DeleteImageProperty(_images,arg1+9);
+              else
+                (void) DeleteImageProperty(_images,arg1);
+              break;
+            }
+            next=_images;
+            for ( ; next != (Image *) NULL; next=GetNextImageInList(next))
+            {
+              value=InterpretImageProperties(_image_info,next,arg2,_exception);
+              if (value == (char *) NULL)
+                CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure",
+                  option);
+              if (LocaleNCompare(arg1,"artifact:",9) == 0)
+                (void) SetImageArtifact(next,arg1+9,value);
+              else
+                if (LocaleNCompare(arg1,"property:",9) == 0)
+                  (void) SetImageProperty(next,arg1+9,value,_exception);
+                else
+                  (void) SetImageProperty(next,arg1,value,_exception);
+              value=DestroyString(value);
+            }
+            break;
+          }
+        MagickResetIterator(&cli_wand->wand);
+        break;
+     }
     if (LocaleCompare("clone",option+1) == 0) {
         Image
           *new_images;
@@ -4632,22 +4701,19 @@ WandExport void CLINoImageOperator(MagickCLI *cli_wand,
         break;
       }
     /*
-       Informational Operations
+       Informational Operations.
 
-       Note that these do not require either cli-wand or images!
+       Note that these do not require either a cli-wand or images!
+       Though currently a cli-wand much be provided regardless.
     */
-    if (LocaleCompare("version",option+1) == 0) {
-      (void) FormatLocaleFile(stdout,"Version: %s\n",
-        GetMagickVersion((size_t *) NULL));
-      (void) FormatLocaleFile(stdout,"Copyright: %s\n",
-        GetMagickCopyright());
-      (void) FormatLocaleFile(stdout,"Features: %s\n\n",
-        GetMagickFeatures());
-      break;
-    }
+    if (LocaleCompare("version",option+1) == 0)
+      {
+        ListMagickVersion(stdout);
+        break;
+      }
     if (LocaleCompare("list",option+1) == 0) {
       /*
-         FUTURE: This 'switch' should really be built into the MagickCore
+         FUTURE: This 'switch' should really be part of MagickCore
       */
       ssize_t
         list;