]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authoranthony <anthony@git.imagemagick.org>
Thu, 29 Mar 2012 12:59:09 +0000 (12:59 +0000)
committeranthony <anthony@git.imagemagick.org>
Thu, 29 Mar 2012 12:59:09 +0000 (12:59 +0000)
MagickWand/magick-cli.c

index 51b6f338a04b64607ad63f396c81fa9f6d950a39..98b77710f60d7fd3c256dc1e93fd27eeaa371fe7 100644 (file)
@@ -280,6 +280,9 @@ WandExport void ProcessScriptOptions(MagickCLI *cli_wand,int argc,char **argv,
       CLISettingOptionInfo(cli_wand, option, arg1);
       // FUTURE: Sync Specific Settings into Image Properities (not global)
     }
+    if ( cli_wand->wand.images != (Image *)NULL )
+      SyncImagesSettings(cli_wand->wand.image_info,cli_wand->wand.images,
+           cli_wand->wand.exception);
 
     if ( (option_type & SimpleOperatorOptionFlag) != 0)
       CLISimpleOperatorImages(cli_wand, option, arg1, arg2);
@@ -481,6 +484,9 @@ WandExport int ProcessCommandOptions(MagickCLI *cli_wand, int argc,
       CLISettingOptionInfo(cli_wand, option, arg1);
       // FUTURE: Sync Specific Settings into Image Properities (not global)
     }
+    if ( cli_wand->wand.images != (Image *)NULL )
+      SyncImagesSettings(cli_wand->wand.image_info,cli_wand->wand.images,
+          cli_wand->wand.exception);
 
     if ( (option_type & SimpleOperatorOptionFlag) != 0)
       CLISimpleOperatorImages(cli_wand, option, arg1, arg2);
@@ -667,16 +673,28 @@ WandExport MagickBooleanType MagickImageCommand(ImageInfo *image_info,
     ThrowConvertException(ResourceLimitError,"MemoryAllocationFailed",
       GetExceptionMessage(errno));
 #endif
+
   /* Initialize special "CLI Wand" to hold images and settings (empty) */
   cli_wand=AcquireMagickCLI(image_info,exception);
 
+  GetPathComponent(argv[0],TailPath,cli_wand->wand.name);
+  ConcatenateMagickString(cli_wand->wand.name,"-CLI",MaxTextExtent);
+
+#if 0
+  /* "convert" command - give a "depreciation" warning" */
+  if ( (LocaleCompare("convert",argv[0]+strlen((argv[0])-7) == 0) ||
+       (LocaleNCompare("convert",argv[0],7) == 0) ||
+       (LocaleNCompare("lt-convert",argv[0],10) == 0) ) {
+       /* output warning */
+  }
+#endif
+
   /* Special Case:  If command name ends with "script" then run it as is
      a "-script" option is implied.  This allows you to name the "magick"
      command "magick-script", and create scripts of the form...
            #!/usr/bin/env magick-script
   */
   if (LocaleCompare("script",argv[0]+strlen(argv[0])-6) == 0) {
-    cli_wand=AcquireMagickCLI(image_info,exception);
     GetPathComponent(argv[1],TailPath,cli_wand->wand.name);
     ProcessScriptOptions(cli_wand,argc,argv,1);
     goto Magick_Command_Cleanup;
@@ -723,7 +741,6 @@ WandExport MagickBooleanType MagickImageCommand(ImageInfo *image_info,
   }
   else {
     /* Normal Command Line, assumes output file as last option */
-    GetPathComponent(argv[0],TailPath,cli_wand->wand.name);
     ProcessCommandOptions(cli_wand,argc,argv,1,
        (LocaleCompare("magick",argv[0]+strlen(argv[0])-6) == 0)?
            MagickCommandOptionFlags : ConvertCommandOptionFlags);