]> granicus.if.org Git - imagemagick/commitdiff
merge of changes to CLI API
authoranthony <anthony@git.imagemagick.org>
Mon, 16 Jan 2012 01:03:11 +0000 (01:03 +0000)
committeranthony <anthony@git.imagemagick.org>
Mon, 16 Jan 2012 01:03:11 +0000 (01:03 +0000)
MagickWand/mogrify.c
MagickWand/operation.c

index 704e22603aea620e1efae42b217410d0d6a6e698..5ce1e1675e04eda04f0bfec9c4b6354d1d36611c 100644 (file)
@@ -108,14 +108,6 @@ static const char
 %    o exception: return any errors or warnings in this structure.
 %
 */
-
-static inline double MagickMin(const double x,const double y)
-{
-  if (x < y)
-    return(x);
-  return(y);
-}
-
 WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info,
   MagickCommand command,int argc,char **argv,char **metadata,
   ExceptionInfo *exception)
@@ -7479,8 +7471,8 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
                 else
                   {
                     /*
-                      Set a blending mask for the composition.  Possible
-                      problem, what if image->mask already set.
+                      Set a blending mask for the composition.
+                      Possible problem, what if image->mask already set.
                     */
                     image->mask=mask_image;
                     (void) NegateImage(image->mask,MagickFalse,exception);
index fa7ae0a0f5149998e826ab0514482f0ed54dd698..a133773ff5976edf652b6643c9166c199779573c 100644 (file)
@@ -385,8 +385,11 @@ static Image *SparseColorOption(const Image *image,
 %  holding the image_info, draw_info, quantize_info structures that will be
 %  later used when processing images.
 %
-%  These options require no images to be present in the wand for them to be
-%  able to be set.  That is they may be used before the first image is read.
+%  These options do no require images to be present in the wand for them to be
+%  able to be set.  That is they may be used without any image in memory.
+%
+%  Options handled by this function are listed in CommandOptions[] of
+%  "option.c" that is one of "SettingInfoOption" option flags.
 %
 %  The format of the ApplySettingOption method is:
 %
@@ -400,7 +403,7 @@ static Image *SparseColorOption(const Image *image,
 %
 %    o option: The option string to be set
 %
-%    o set_option: is the option being set, or reset to some default
+%    o set_option: is the option being set (-), or reset (+) to some default
 %
 %    o arg: the single argument (if needed) to set this option.
 %
@@ -564,8 +567,8 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand,
         }
       if (LocaleCompare("caption",option) == 0)
         {
-          (void) SetImageOption(image_info,option,IfSetOption ? arg :
-            (const char*)NULL);
+          (void) SetImageOption(image_info,option,
+               IfSetOption ? arg : (const char*)NULL);
           break;
         }
       if (LocaleCompare("channel",option) == 0)
@@ -832,8 +835,8 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand,
           */
           if (IfSetOption)
             {
-              image_info->fuzz=StringToDoubleInterval(arg,(double) QuantumRange+
-                1.0);
+              image_info->fuzz=StringToDoubleInterval(arg,(double)
+                QuantumRange+1.0);
               (void) SetImageOption(image_info,option,arg);
               break;
             }
@@ -1852,7 +1855,7 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand,
       if (LocaleCompare("channel",option) == 0)
         {
           /* The "channel" setting has already been set */
-          SetPixelChannelMap(*image,image_info->channel);
+          SetPixelChannelMapMask(*image,image_info->channel);
           break;
         }
       if (LocaleCompare("charcoal",option) == 0)
@@ -2160,19 +2163,19 @@ WandExport MagickBooleanType ApplySettingsOption(MagickWand *wand,
           (void) SyncImageSettings(image_info,*image,exception);
           method=(DistortImageMethod) ParseCommandOption(MagickDistortOptions,
             MagickFalse,args[0]);
-          if ( method == ResizeDistortion )
+          if (method == ResizeDistortion)
             {
+               double
+                 resize_args[2];
                /* Special Case - Argument is actually a resize geometry!
                ** Convert that to an appropriate distortion argument array.
                */
-               double
-                 resize_args[2];
                (void) ParseRegionGeometry(*image,argv[2],&geometry,
-                    exception);
-               resize_args[0]=(double)geometry.width;
-               resize_args[1]=(double)geometry.height;
+                 exception);
+               resize_args[0]=(double) geometry.width;
+               resize_args[1]=(double) geometry.height;
                new_image=DistortImage(*image,method,(size_t)2,
-                    resize_args,MagickTrue,exception);
+                 resize_args,MagickTrue,exception);
                break;
             }
           args=InterpretImageProperties(image_info,*image,argv[2],
@@ -3862,7 +3865,7 @@ WandExport MagickBooleanType SequenceOperationImages(ImageInfo *image_info,
                 {
                   /*
                     Set a blending mask for the composition.
-                    Posible error, what if image->mask already set.
+                    Possible problem, what if image->mask already set.
                   */
                   image->mask=mask_image;
                   (void) NegateImage(image->mask,MagickFalse,exception);
@@ -3871,7 +3874,10 @@ WandExport MagickBooleanType SequenceOperationImages(ImageInfo *image_info,
           (void) CompositeImage(image,compose,composite_image,
             geometry.x,geometry.y,exception);
           if (mask_image != (Image *) NULL)
-            mask_image=image->mask=DestroyImage(image->mask);
+            {
+              image->mask=DestroyImage(image->mask);
+              mask_image=(Image *) NULL;
+            }
           composite_image=DestroyImage(composite_image);
           *images=DestroyImageList(*images);
           *images=image;