Changeset 7954


Ignore:
Timestamp:
05/17/12 19:39:46 (12 months ago)
Author:
anthony
Message:

Interpret all Option arguments (apart from a select few)

Location:
ImageMagick/trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/MagickCore/option.c

    r7924 r7954  
    200200    { "-alpha", 1L, SimpleOperatorFlag, MagickFalse }, 
    201201    { "+annotate", 0L, DeprecateOptionFlag, MagickTrue }, 
    202     { "-annotate", 2L, SimpleOperatorFlag, MagickFalse }, 
     202    { "-annotate", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, 
    203203    { "+antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse }, 
    204204    { "-antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse }, 
     
    340340    { "+dissimilarity-threshold", 0L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse }, 
    341341    { "-dissimilarity-threshold", 1L, NonMagickOptionFlag | ImageInfoOptionFlag, MagickFalse }, 
    342     { "+distort", 2L, SimpleOperatorFlag, MagickFalse }, 
    343     { "-distort", 2L, SimpleOperatorFlag, MagickFalse }, 
     342    { "+distort", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, 
     343    { "-distort", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, 
    344344    { "+dither", 0L, ImageInfoOptionFlag | QuantizeInfoOptionFlag, MagickFalse }, 
    345345    { "-dither", 1L, ImageInfoOptionFlag | QuantizeInfoOptionFlag, MagickFalse }, 
     
    400400    { "-frame", 1L, SimpleOperatorFlag, MagickFalse }, 
    401401    { "+function", 2L, DeprecateOptionFlag, MagickTrue }, 
    402     { "-function", 2L,SimpleOperatorFlag, MagickFalse }, 
     402    { "-function", 2L,SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, 
    403403    { "+fuzz", 0L, ImageInfoOptionFlag, MagickFalse }, 
    404404    { "-fuzz", 1L, ImageInfoOptionFlag, MagickFalse }, 
     
    543543    { "-preview", 1L, GlobalOptionFlag, MagickFalse }, 
    544544    { "+print", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, 
    545     { "-print", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse }, 
     545    { "-print", 1L, ListOperatorFlag | AlwaysInterpretArgsFlag | FireOptionFlag, MagickFalse }, 
    546546    { "+process", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, 
    547547    { "-process", 1L, ListOperatorFlag | FireOptionFlag, MagickFalse }, 
     
    618618    { "+sepia-tone", 1L, DeprecateOptionFlag, MagickTrue }, 
    619619    { "-sepia-tone", 1L, SimpleOperatorFlag, MagickFalse }, 
    620     { "+set", 1L, SimpleOperatorFlag, MagickFalse }, 
    621     { "-set", 2L, SimpleOperatorFlag, MagickFalse }, 
     620    { "+set", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, 
     621    { "-set", 2L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, 
    622622    { "+shade", 0L, DeprecateOptionFlag, MagickTrue }, 
    623623    { "-shade", 1L, SimpleOperatorFlag, MagickFalse }, 
     
    647647    { "-solarize", 1L, SimpleOperatorFlag, MagickFalse }, 
    648648    { "+sparse-color", 1L, DeprecateOptionFlag, MagickTrue }, 
    649     { "-sparse-color", 2L, SimpleOperatorFlag, MagickFalse }, 
     649    { "-sparse-color", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, 
    650650    { "+splice", 1L, DeprecateOptionFlag, MagickTrue }, 
    651651    { "-splice", 1L, SimpleOperatorFlag, MagickFalse }, 
  • ImageMagick/trunk/MagickCore/option.h

    r7587 r7954  
    126126  QuantizeInfoOptionFlag    = 0x0004,  /* Setting stored in QuantizeInfo */ 
    127127  GlobalOptionFlag          = 0x0008,  /* Global Setting or Control */ 
    128   SettingOptionFlags        = 0x000F,  /* mask for all setting options */ 
     128  SettingOptionFlags        = 0x000F,  /* mask any setting option */ 
    129129 
    130130  NoImageOperatorFlag       = 0x0010,  /* Images not required operator */ 
     
    135135  SpecialOptionFlag         = 0x0100,  /* Operator with Special Requirements */ 
    136136                                       /* EG: for specific CLI commands */ 
     137 
     138  AlwaysInterpretArgsFlag   = 0x0400,  /* Always Interpret escapes in Args */ 
     139  NeverInterpretArgsFlag    = 0x0800,  /* Never Interpret escapes in Args */ 
    137140 
    138141  NonMagickOptionFlag       = 0x1000,  /* Option not used by Magick Command */ 
  • ImageMagick/trunk/MagickCore/property.c

    r7928 r7954  
    29562956    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); 
    29572957 
    2958   if ((embed_text == (const char *) NULL) || (*embed_text == '\0')) 
     2958  if ((embed_text == (const char *) NULL)) 
    29592959    return((char *) NULL); 
    29602960  p=embed_text; 
     2961 
     2962  if (*p == '\0') 
     2963    return(ConstantString("")); 
    29612964 
    29622965  /* handle a '@' replace string from file */ 
  • ImageMagick/trunk/MagickWand/magick-cli.c

    r7883 r7954  
    6565#define MagickCommandDebug 0 
    6666 
    67  
    6867#if MagickCommandDebug >= 9 
    6968/* 
     
    7877    *value; 
    7978 
    80   (void) FormatLocaleFile(stdout,"  Global Options:\n"); 
     79  (void) FormatLocaleFile(stderr,"  Global Options:\n"); 
    8180  ResetImageOptionIterator(image_info); 
    8281  while ((option=GetNextImageOption(image_info)) != (const char *) NULL ) { 
    83     (void) FormatLocaleFile(stdout,"    %s: ",option); 
     82    (void) FormatLocaleFile(stderr,"    %s: ",option); 
    8483    value=GetImageOption(image_info,option); 
    8584    if (value != (const char *) NULL) 
    86       (void) FormatLocaleFile(stdout,"%s\n",value); 
     85      (void) FormatLocaleFile(stderr,"%s\n",value); 
    8786  } 
    8887  ResetImageOptionIterator(image_info); 
     
    9594    *value; 
    9695 
    97   (void) FormatLocaleFile(stdout,"  Image Artifacts:\n"); 
     96  (void) FormatLocaleFile(stderr,"  Image Artifacts:\n"); 
    9897  ResetImageArtifactIterator(image); 
    9998  while ((artifact=GetNextImageArtifact(image)) != (const char *) NULL ) { 
    100     (void) FormatLocaleFile(stdout,"    %s: ",artifact); 
     99    (void) FormatLocaleFile(stderr,"    %s: ",artifact); 
    101100    value=GetImageArtifact(image,artifact); 
    102101    if (value != (const char *) NULL) 
    103       (void) FormatLocaleFile(stdout,"%s\n",value); 
     102      (void) FormatLocaleFile(stderr,"%s\n",value); 
    104103  } 
    105104  ResetImageArtifactIterator(image); 
     
    112111    *value; 
    113112 
    114   (void) FormatLocaleFile(stdout,"  Image Properity:\n"); 
     113  (void) FormatLocaleFile(stderr,"  Image Properity:\n"); 
    115114  ResetImagePropertyIterator(image); 
    116115  while ((property=GetNextImageProperty(image)) != (const char *) NULL ) { 
    117     (void) FormatLocaleFile(stdout,"    %s: ",property); 
     116    (void) FormatLocaleFile(stderr,"    %s: ",property); 
    118117    value=GetImageProperty(image,property,exception); 
    119118    if (value != (const char *) NULL) 
    120       (void) FormatLocaleFile(stdout,"%s\n",value); 
     119      (void) FormatLocaleFile(stderr,"%s\n",value); 
    121120  } 
    122121  ResetImagePropertyIterator(image); 
     
    217216    } 
    218217 
    219     /* save option details */ 
    220     CloneString(&option,token_info->token); 
    221  
    222     /* get option, its argument count, and option type */ 
    223     cli_wand->command = GetCommandOptionInfo(option); 
    224     count=cli_wand->command->type; 
    225     option_type=(CommandOptionFlags) cli_wand->command->flags; 
     218    do { /* use break to loop to exception handler and loop */ 
     219 
     220      /* save option details */ 
     221      CloneString(&option,token_info->token); 
     222 
     223      /* get option, its argument count, and option type */ 
     224      cli_wand->command = GetCommandOptionInfo(option); 
     225      count=cli_wand->command->type; 
     226      option_type=(CommandOptionFlags) cli_wand->command->flags; 
    226227#if 0 
    227     (void) FormatLocaleFile(stderr, "Script: %u,%u: \"%s\" matched \"%s\"\n", 
     228      (void) FormatLocaleFile(stderr, "Script: %u,%u: \"%s\" matched \"%s\"\n", 
    228229          cli_wand->line, cli_wand->line, option, cli_wand->command->mnemonic ); 
    229230#endif 
    230231 
    231     /* handle a undefined option - image read? */ 
    232     if ( option_type == UndefinedOptionFlag || 
    233          (option_type & NonMagickOptionFlag) != 0 ) { 
     232      /* handle a undefined option - image read - always for "magick-script" */ 
     233      if ( option_type == UndefinedOptionFlag || 
     234           (option_type & NonMagickOptionFlag) != 0 ) { 
    234235#if MagickCommandDebug >= 3 
    235       (void) FormatLocaleFile(stderr, "Script %u,%u Non-Option: \"%s\"\n", 
    236                   cli_wand->line, cli_wand->line, option); 
    237 #endif 
    238       if ( IfMagickFalse(IsCommandOption(option))) { 
    239         /* non-option -- treat as a image read */ 
    240         cli_wand->command=(const OptionInfo *)NULL; 
    241         CLIOption(cli_wand,"-read",option); 
    242         goto next_token; 
    243       } 
    244       CLIWandExceptionBreak(OptionFatalError,"UnrecognizedOption",option); 
    245       goto next_token; 
    246     } 
    247  
    248     if ( count >= 1 ) { 
    249       if( IfMagickFalse(GetScriptToken(token_info)) ) 
    250         CLIWandException(OptionFatalError,"MissingArgument",option); 
    251       CloneString(&arg1,token_info->token); 
    252     } 
    253     else 
    254       CloneString(&arg1,(char *)NULL); 
    255  
    256     if ( count >= 2 ) { 
    257       if( IfMagickFalse(GetScriptToken(token_info)) ) 
    258         CLIWandExceptionBreak(OptionFatalError,"MissingArgument",option); 
    259       CloneString(&arg2,token_info->token); 
    260     } 
    261     else 
    262       CloneString(&arg2,(char *)NULL); 
    263  
    264  
    265     /* 
    266       Process Options 
    267     */ 
     236        (void) FormatLocaleFile(stderr, "Script %u,%u Non-Option: \"%s\"\n", 
     237                    cli_wand->line, cli_wand->line, option); 
     238#endif 
     239        if ( IfMagickFalse(IsCommandOption(option))) { 
     240          /* non-option -- treat as a image read */ 
     241          cli_wand->command=(const OptionInfo *)NULL; 
     242          CLIOption(cli_wand,"-read",option); 
     243          break; /* next option */ 
     244        } 
     245        CLIWandException(OptionFatalError,"UnrecognizedOption",option); 
     246        break; /* next option */ 
     247      } 
     248 
     249      if ( count >= 1 ) { 
     250        if( IfMagickFalse(GetScriptToken(token_info)) ) 
     251          CLIWandException(OptionFatalError,"MissingArgument",option); 
     252        CloneString(&arg1,token_info->token); 
     253      } 
     254      else 
     255        CloneString(&arg1,(char *)NULL); 
     256 
     257      if ( count >= 2 ) { 
     258        if( IfMagickFalse(GetScriptToken(token_info)) ) 
     259          CLIWandExceptionBreak(OptionFatalError,"MissingArgument",option); 
     260        CloneString(&arg2,token_info->token); 
     261      } 
     262      else 
     263        CloneString(&arg2,(char *)NULL); 
     264 
     265      /* 
     266        Process Options 
     267      */ 
    268268#if MagickCommandDebug >= 3 
    269     (void) FormatLocaleFile(stderr, 
    270       "Script %u,%u Option: \"%s\"  Count: %d  Flags: %04x  Args: \"%s\" \"%s\"\n", 
    271           cli_wand->line,cli_wand->line,option,count,option_type,arg1,arg2); 
    272 #endif 
    273     /* Hard Depreciated Options, no code to execute - error */ 
    274     if ( (option_type & DeprecateOptionFlag) != 0 ) { 
    275       CLIWandException(OptionError,"DeprecatedOptionNoCode",option); 
    276       if ( IfMagickTrue(CLICatchException(cli_wand, MagickFalse)) ) 
    277         break; 
    278       goto next_token; 
    279     } 
    280  
    281     /* MagickCommandGenesis() options have no place in a magick script */ 
    282     if ( (option_type & GenesisOptionFlag) != 0 ) { 
    283       CLIWandExceptionBreak(OptionError,"InvalidUseOfOption",option); 
    284       goto next_token; 
    285     } 
    286  
    287     if ( (option_type & SpecialOptionFlag) != 0 ) { 
    288       if ( LocaleCompare(option,"-exit") == 0 ) { 
    289         break; /* forced end of script */ 
    290       } 
    291       if ( LocaleCompare(option,"-script") == 0 ) { 
    292         /* FUTURE: call new script from this script */ 
    293         CLIWandExceptionBreak(OptionError,"InvalidUseOfOption",option); 
    294         goto next_token; 
    295       } 
    296       /* FUTURE: handle special script-argument options here */ 
    297       /* handle any other special operators now */ 
    298       CLIWandExceptionBreak(OptionError,"InvalidUseOfOption",option); 
    299       goto next_token; 
    300     } 
    301  
    302     /* Process non-specific Option */ 
    303     CLIOption(cli_wand, option, arg1, arg2); 
    304  
    305 next_token: 
     269      (void) FormatLocaleFile(stderr, 
     270        "Script %u,%u Option: \"%s\"  Count: %d  Flags: %04x  Args: \"%s\" \"%s\"\n", 
     271            cli_wand->line,cli_wand->line,option,count,option_type,arg1,arg2); 
     272#endif 
     273      /* Hard Depreciated Options, no code to execute - error */ 
     274      if ( (option_type & DeprecateOptionFlag) != 0 ) { 
     275        CLIWandException(OptionError,"DeprecatedOptionNoCode",option); 
     276        break; /* next option */ 
     277      } 
     278 
     279      /* MagickCommandGenesis() options have no place in a magick script */ 
     280      if ( (option_type & GenesisOptionFlag) != 0 ) { 
     281        CLIWandException(OptionError,"InvalidUseOfOption",option); 
     282        break; /* next option */ 
     283      } 
     284 
     285      /* handle any special 'script' options */ 
     286      if ( (option_type & SpecialOptionFlag) != 0 ) { 
     287        if ( LocaleCompare(option,"-exit") == 0 ) { 
     288          break; /* forced end of script */ 
     289        } 
     290        if ( LocaleCompare(option,"-script") == 0 ) { 
     291          /* FUTURE: call new script from this script - error for now */ 
     292          CLIWandException(OptionError,"InvalidUseOfOption",option); 
     293          break; /* next option */ 
     294        } 
     295        /* FUTURE: handle special script-argument options here */ 
     296        /* handle any other special operators now */ 
     297        CLIWandException(OptionError,"InvalidUseOfOption",option); 
     298        break; /* next option */ 
     299      } 
     300 
     301      /* Process non-specific Option */ 
     302      CLIOption(cli_wand, option, arg1, arg2); 
     303 
     304    } while (0); /* break block to next option */ 
     305 
    306306#if MagickCommandDebug >= 9 
    307307    OutputOptions(cli_wand->wand.image_info); 
     
    311311    } 
    312312#endif 
    313     if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) 
    314       break; 
    315   } 
    316  
     313    if ( IfMagickTrue(CLICatchException(cli_wand, MagickFalse)) ) 
     314      break;  /* exit loop */ 
     315  } 
     316 
     317  /* 
     318     Loop exit - check for some tokenization error 
     319  */ 
    317320#if MagickCommandDebug >= 3 
    318321  (void) FormatLocaleFile(stderr, "Script End: %d\n", token_info->status); 
     
    429432 
    430433  end = argc; 
    431   if ( (cli_wand->process_flags & ProcessImpliedWrite) != 0 ) 
     434  if ( (cli_wand->process_flags & ProcessImplictWrite) != 0 ) 
    432435    end--; /* the last arument is an implied write, do not process directly */ 
    433436 
     
    437440      return(i); 
    438441 
    439     option=argv[i]; 
    440     cli_wand->line=i;  /* note the argument for this option */ 
    441  
    442     /* get option, its argument count, and option type */ 
    443     cli_wand->command = GetCommandOptionInfo(argv[i]); 
    444     count=cli_wand->command->type; 
    445     option_type=(CommandOptionFlags) cli_wand->command->flags; 
     442    do { /* use break to loop to exception handler and loop */ 
     443 
     444      option=argv[i]; 
     445      cli_wand->line=i;  /* note the argument for this option */ 
     446 
     447      /* get option, its argument count, and option type */ 
     448      cli_wand->command = GetCommandOptionInfo(argv[i]); 
     449      count=cli_wand->command->type; 
     450      option_type=(CommandOptionFlags) cli_wand->command->flags; 
    446451#if 0 
    447     (void) FormatLocaleFile(stderr, "CLI %d: \"%s\" matched \"%s\"\n", 
    448           i, argv[i], cli_wand->command->mnemonic ); 
    449 #endif 
    450  
    451     if ( option_type == UndefinedOptionFlag || 
    452          (option_type & NonMagickOptionFlag) != 0 ) { 
     452      (void) FormatLocaleFile(stderr, "CLI %d: \"%s\" matched \"%s\"\n", 
     453            i, argv[i], cli_wand->command->mnemonic ); 
     454#endif 
     455 
     456      if ( option_type == UndefinedOptionFlag || 
     457           (option_type & NonMagickOptionFlag) != 0 ) { 
    453458#if MagickCommandDebug >= 3 
    454       (void) FormatLocaleFile(stderr, "CLI %d Non-Option: \"%s\"\n", i, option); 
    455 #endif 
    456       if ( IfMagickFalse(IsCommandOption(option)) ) { 
    457         if ( (cli_wand->process_flags & ProcessNonOptionImageRead) != 0 ) { 
    458           /* non-option -- treat as a image read */ 
    459           cli_wand->command=(const OptionInfo *)NULL; 
    460           CLIOption(cli_wand,"-read",option); 
    461           goto next_argument; 
     459        (void) FormatLocaleFile(stderr, "CLI %d Non-Option: \"%s\"\n", i, option); 
     460#endif 
     461        if ( IfMagickFalse(IsCommandOption(option)) ) { 
     462          if ( (cli_wand->process_flags & ProcessImplictRead) != 0 ) { 
     463            /* non-option -- treat as a image read */ 
     464            cli_wand->command=(const OptionInfo *)NULL; 
     465            CLIOption(cli_wand,"-read",option); 
     466            break; /* next option */ 
     467          } 
    462468        } 
    463       } 
    464       CLIWandException(OptionFatalError,"UnrecognizedOption",option); 
    465       goto next_argument; 
    466     } 
    467  
    468     if ( ((option_type & SpecialOptionFlag) != 0 ) && 
    469          ((cli_wand->process_flags & ProcessScriptOption) != 0) && 
    470          (LocaleCompare(option,"-script") == 0) ) { 
    471       /* Call Script from CLI, with a filename as a zeroth argument. 
    472          NOTE: -script may need to use the 'implict write filename' argument 
    473          so it must be handled specially to prevent a 'missing argument' error. 
     469        CLIWandException(OptionFatalError,"UnrecognizedOption",option); 
     470        break; /* next option */ 
     471      } 
     472 
     473      if ( ((option_type & SpecialOptionFlag) != 0 ) && 
     474           ((cli_wand->process_flags & ProcessScriptOption) != 0) && 
     475           (LocaleCompare(option,"-script") == 0) ) { 
     476        /* Call Script from CLI, with a filename as a zeroth argument. 
     477           NOTE: -script may need to use the 'implict write filename' argument 
     478           so it must be handled specially to prevent a 'missing argument' error. 
     479        */ 
     480        if ( (i+count) >= argc ) 
     481          CLIWandException(OptionFatalError,"MissingArgument",option); 
     482        ProcessScriptOptions(cli_wand,argc,argv,i+1); 
     483        return(argc);  /* Script does not return to CLI -- Yet */ 
     484                       /* FUTURE: when it does, their may be no write arg! */ 
     485      } 
     486 
     487      if ((i+count) >= end ) { 
     488        CLIWandException(OptionFatalError,"MissingArgument",option); 
     489        if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) 
     490          return(end); 
     491        break; /* next option - not that their is any! */ 
     492      } 
     493 
     494      arg1 = ( count >= 1 ) ? argv[i+1] : (char *)NULL; 
     495      arg2 = ( count >= 2 ) ? argv[i+2] : (char *)NULL; 
     496 
     497      /* 
     498        Process Known Options 
    474499      */ 
    475       if ( (i+count) >= argc ) 
    476         CLIWandException(OptionFatalError,"MissingArgument",option); 
    477       ProcessScriptOptions(cli_wand,argc,argv,i+1); 
    478       return(argc);  /* Script does not return to CLI -- Yet */ 
    479                      /* FUTURE: when it does, their may be no write arg! */ 
    480     } 
    481  
    482     if ((i+count) >= end ) { 
    483       CLIWandException(OptionFatalError,"MissingArgument",option); 
    484       if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) 
    485         return(end); 
    486       goto next_argument; /* no more arguments unable to proceed */ 
    487     } 
    488  
    489     arg1 = ( count >= 1 ) ? argv[i+1] : (char *)NULL; 
    490     arg2 = ( count >= 2 ) ? argv[i+2] : (char *)NULL; 
    491  
    492     /* 
    493       Process Known Options 
    494     */ 
    495500#if MagickCommandDebug >= 3 
    496     (void) FormatLocaleFile(stderr, 
    497       "CLI %u Option: \"%s\"  Count: %d  Flags: %04x  Args: \"%s\" \"%s\"\n", 
    498           i,option,count,option_type,arg1,arg2); 
    499 #endif 
    500  
    501     if ( (option_type & GenesisOptionFlag) != 0 ) 
    502       goto next_argument; /* ignored this from command line args */ 
    503  
    504     if ( (option_type & SpecialOptionFlag) != 0 ) { 
    505       if ( (cli_wand->process_flags & ProcessExitOption) != 0 
    506            && LocaleCompare(option,"-exit") == 0 ) 
    507         return(i+count); 
    508       goto next_argument; 
    509     } 
    510  
    511     /* Process a Normal Option */ 
    512     CLIOption(cli_wand, option, arg1, arg2); 
    513  
    514 next_argument: 
     501      (void) FormatLocaleFile(stderr, 
     502        "CLI %u Option: \"%s\"  Count: %d  Flags: %04x  Args: \"%s\" \"%s\"\n", 
     503            i,option,count,option_type,arg1,arg2); 
     504#endif 
     505 
     506      /* ignore 'genesis options' in command line args */ 
     507      if ( (option_type & GenesisOptionFlag) != 0 ) 
     508        break; /* next option */ 
     509 
     510      /* Handle any special options for CLI (-script handled above) */ 
     511      if ( (option_type & SpecialOptionFlag) != 0 ) { 
     512        if ( (cli_wand->process_flags & ProcessExitOption) != 0 
     513             && LocaleCompare(option,"-exit") == 0 ) 
     514          return(i+count); 
     515        break; /* next option */ 
     516      } 
     517 
     518      /* Process standard image option */ 
     519      CLIOption(cli_wand, option, arg1, arg2); 
     520 
     521    } while (0); /* break block to next option */ 
     522 
    515523#if MagickCommandDebug >= 9 
    516524    OutputOptions(cli_wand->wand.image_info); 
     
    525533  assert(i==end); 
    526534 
    527   if ( (cli_wand->process_flags & ProcessImpliedWrite) == 0 ) 
     535  if ( (cli_wand->process_flags & ProcessImplictWrite) == 0 ) 
    528536    return(end); /* no implied write -- just return to caller */ 
    529537 
     
    536544  cli_wand->line=i; 
    537545 
     546  /* check that stacks are empty - or cause exception */ 
     547  if (cli_wand->image_list_stack != (Stack *)NULL) 
     548    CLIWandException(OptionError,"UnbalancedParenthesis", "(end of cli)"); 
     549  else if (cli_wand->image_info_stack != (Stack *)NULL) 
     550    CLIWandException(OptionError,"UnbalancedBraces", "(end of cli)"); 
     551  if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) 
     552    return(argc); 
     553 
    538554#if MagickCommandDebug >= 3 
    539555  (void) FormatLocaleFile(stderr, "CLI %d Write File: \"%s\"\n", i, option ); 
    540556#endif 
    541557 
    542   /* check that stacks are empty */ 
    543   if (cli_wand->image_list_stack != (Stack *)NULL) 
    544     CLIWandException(OptionError,"UnbalancedParenthesis", "(eof)"); 
    545   else if (cli_wand->image_info_stack != (Stack *)NULL) 
    546     CLIWandException(OptionError,"UnbalancedBraces", "(eof)"); 
    547   if ( CLICatchException(cli_wand, MagickFalse) != MagickFalse ) 
    548     return(argc); 
    549  
    550   /* This is a valid 'do no write' option - no images needed */ 
     558  /* Valid 'do no write' replacement option (instead of "null:") */ 
    551559  if (LocaleCompare(option,"-exit") == 0 ) 
    552560    return(argc);  /* just exit, no image write */ 
  • ImageMagick/trunk/MagickWand/operation.c

    r7945 r7954  
    16011601*/ 
    16021602static void CLISimpleOperatorImage(MagickCLI *cli_wand, 
    1603   const char *option, const char *arg1, const char *arg2) 
     1603  const char *option, const char *arg1n, const char *arg2n) 
    16041604{ 
    16051605  Image * 
     
    16171617  ssize_t 
    16181618    parse; 
     1619 
     1620  const char    /* For percent escape interpretImageProperties() */ 
     1621    *arg1, 
     1622    *arg2; 
    16191623 
    16201624#define _image_info     (cli_wand->wand.image_info) 
     
    16231627#define _draw_info      (cli_wand->draw_info) 
    16241628#define _quantize_info  (cli_wand->quantize_info) 
     1629#define _process_flags  (cli_wand->process_flags) 
     1630#define _option_type    ((CommandOptionFlags) cli_wand->command->flags) 
    16251631#define IfNormalOp      (*option=='-') 
    16261632#define IfPlusOp        (*option!='-') 
     
    16351641    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); 
    16361642 
     1643  /* Interpret Percent Escapes in Arguments - using first image */ 
     1644  arg1 = arg1n, 
     1645  arg2 = arg2n; 
     1646  if ( (((_process_flags & ProcessInterpretProperities) != 0 ) 
     1647        || ((_option_type & AlwaysInterpretArgsFlag) != 0) 
     1648       )  && ((_option_type & NeverInterpretArgsFlag) == 0) ) { 
     1649    /* Interpret Percent escapes in argument 1 */ 
     1650    if (arg1n != (char *) NULL) { 
     1651      arg1=InterpretImageProperties(_image_info,_image,arg1n,_exception); 
     1652      if (arg1 == (char *) NULL) { 
     1653        CLIWandException(OptionWarning,"InterpretPropertyFailure",option); 
     1654        arg1=arg1n;  /* use the given argument as is */ 
     1655      } 
     1656    } 
     1657    if (arg2n != (char *) NULL) { 
     1658      arg2=InterpretImageProperties(_image_info,_image,arg2n,_exception); 
     1659      if (arg2 == (char *) NULL) { 
     1660        CLIWandException(OptionWarning,"InterpretPropertyFailure",option); 
     1661        arg2=arg2n;  /* use the given argument as is */ 
     1662      } 
     1663    } 
     1664  } 
     1665#undef _option_type 
     1666 
     1667#if 0 
     1668  (void) FormatLocaleFile(stderr, 
     1669    "CLISimpleOperatorImage: \"%s\" \"%s\" \"%s\"\n",option,arg1,arg2); 
     1670#endif 
     1671 
     1672  new_image = (Image *)NULL; /* the replacement image, if not null at end */ 
    16371673  SetGeometryInfo(&geometry_info); 
    16381674 
    1639   new_image = (Image *)NULL; /* the replacement image, if not null at end */ 
    1640  
    1641   /* FUTURE: We may need somthing a little more optimized than this! 
    1642      Perhaps, do the 'sync' if 'settings tainted' before next operator. 
    1643   */ 
    16441675  switch (*(option+1)) 
    16451676  { 
     
    16911722        { 
    16921723          char 
    1693             *text, 
    16941724            geometry[MaxTextExtent]; 
    16951725 
     
    17001730          if ((flags & SigmaValue) == 0) 
    17011731            geometry_info.sigma=geometry_info.rho; 
    1702           text=InterpretImageProperties(_image_info,_image,arg2, 
    1703             _exception); 
    1704           if (text == (char *) NULL) 
    1705             break; 
    1706           (void) CloneString(&_draw_info->text,text); 
    1707           text=DestroyString(text); 
     1732          (void) CloneString(&_draw_info->text,arg2); 
    17081733          (void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f", 
    17091734            geometry_info.xi,geometry_info.psi); 
     
    21342159      if (LocaleCompare("distort",option+1) == 0) 
    21352160        { 
    2136           char 
    2137             *arg; 
    2138  
    21392161          double 
    21402162            *args; 
     
    21652187               break; 
    21662188            } 
    2167           /* allow percent escapes in argument string */ 
    2168           arg=InterpretImageProperties(_image_info,_image,arg2,_exception); 
    2169           if (arg == (char *) NULL) 
    2170             break; 
    21712189          /* convert argument string into an array of doubles */ 
    2172           args = StringToArrayOfDoubles(arg,&count,_exception); 
    2173           arg=DestroyString(arg); 
     2190          args = StringToArrayOfDoubles(arg2,&count,_exception); 
    21742191          if (args == (double *)NULL ) 
    21752192            CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2); 
     
    23382355      if (LocaleCompare("function",option+1) == 0) 
    23392356        { 
    2340           char 
    2341             *arg; 
    2342  
    23432357          double 
    23442358            *args; 
     
    23512365            CLIWandExceptArgBreak(OptionError,"UnrecognizedFunction", 
    23522366                 option,arg1); 
    2353           /* allow percent escapes in argument string */ 
    2354           arg=InterpretImageProperties(_image_info,_image,arg2,_exception); 
    2355           if (arg == (char *) NULL) 
    2356             break; 
    23572367          /* convert argument string into an array of doubles */ 
    2358           args = StringToArrayOfDoubles(arg,&count,_exception); 
    2359           arg=DestroyString(arg); 
     2368          args = StringToArrayOfDoubles(arg2,&count,_exception); 
    23602369          if (args == (double *)NULL ) 
    23612370            CLIWandExceptArgBreak(OptionError,"InvalidNumberList",option,arg2); 
     
    24322441 
    24332442          format=GetImageOption(_image_info,"format"); 
    2434           if (format == (char *) NULL) 
    2435             { 
    2436               (void) IdentifyImage(_image,stdout,_image_info->verbose, 
    2437                 _exception); 
    2438               break; 
    2439             } 
     2443          if (format == (char *) NULL) { 
     2444            (void) IdentifyImage(_image,stdout,_image_info->verbose,_exception); 
     2445            break; 
     2446          } 
    24402447          text=InterpretImageProperties(_image_info,_image,format,_exception); 
    24412448          if (text == (char *) NULL) 
    2442             break; 
     2449            CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure", 
     2450                 option); 
    24432451          (void) fputs(text,stdout); 
    24442452          (void) fputc('\n',stdout); 
     
    30713079          value=InterpretImageProperties(_image_info,_image,arg2,_exception); 
    30723080          if (value == (char *) NULL) 
    3073             break; 
     3081            CLIWandExceptionBreak(OptionWarning,"InterpretPropertyFailure", 
     3082                  option); 
    30743083          if (LocaleNCompare(arg1,"registry:",9) == 0) 
    30753084            (void) SetImageRegistry(StringRegistryType,arg1+9,value,_exception); 
     
    31773186      if (LocaleCompare("sparse-color",option+1) == 0) 
    31783187        { 
    3179           char 
    3180             *arguments; 
    3181  
    31823188          parse= ParseCommandOption(MagickSparseColorOptions,MagickFalse,arg1); 
    31833189          if ( parse < 0 ) 
    31843190            CLIWandExceptArgBreak(OptionError,"UnrecognizedSparseColorMethod", 
    31853191                option,arg1); 
    3186           arguments=InterpretImageProperties(_image_info,_image,arg2,_exception); 
    3187           if (arguments == (char *) NULL) 
    3188             CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg2); 
    3189           new_image=SparseColorOption(_image,(SparseColorMethod)parse, 
    3190                arguments,_exception); 
    3191           arguments=DestroyString(arguments); 
     3192          new_image=SparseColorOption(_image,(SparseColorMethod)parse,arg2, 
     3193               _exception); 
    31923194          break; 
    31933195        } 
     
    34053407      CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option); 
    34063408  } 
    3407   /* 
    3408      Replace current image with any image that was generated 
    3409      and set image point to last image (so image->next is correct) 
    3410   */ 
     3409  /* clean up percent escape interpreted strings */ 
     3410  if (arg1 != arg1n ) 
     3411    arg1=DestroyString((char *)arg1); 
     3412  if (arg2 != arg2n ) 
     3413    arg2=DestroyString((char *)arg2); 
     3414 
     3415  /* Replace current image with any image that was generated 
     3416     and set image point to last image (so image->next is correct) */ 
    34113417  if (new_image != (Image *) NULL) 
    34123418    ReplaceImageInListReturnLast(&_image,new_image); 
     
    34923498*/ 
    34933499WandExport void CLIListOperatorImages(MagickCLI *cli_wand, 
    3494      const char *option,const char *arg1, const char *magick_unused(arg2)) 
     3500     const char *option,const char *arg1n, const char *arg2n) 
    34953501{ 
    34963502  ssize_t 
     
    34993505  Image 
    35003506    *new_images; 
     3507 
     3508  const char    /* For percent escape interpretImageProperties() */ 
     3509    *arg1, 
     3510    *arg2; 
    35013511 
    35023512#define _image_info     (cli_wand->wand.image_info) 
     
    35053515#define _draw_info      (cli_wand->draw_info) 
    35063516#define _quantize_info  (cli_wand->quantize_info) 
     3517#define _process_flags  (cli_wand->process_flags) 
     3518#define _option_type    ((CommandOptionFlags) cli_wand->command->flags) 
    35073519#define IfNormalOp      (*option=='-') 
    35083520#define IfPlusOp        (*option!='-') 
     
    35153527  if (IfMagickTrue(cli_wand->wand.debug)) 
    35163528    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); 
     3529 
     3530  /* Interpret Percent Escapes in Arguments - using first image */ 
     3531  arg1 = arg1n; 
     3532  arg2 = arg2n; 
     3533  if ( (((_process_flags & ProcessInterpretProperities) != 0 ) 
     3534        || ((_option_type & AlwaysInterpretArgsFlag) != 0) 
     3535       )  && ((_option_type & NeverInterpretArgsFlag) == 0) ) { 
     3536    /* Interpret Percent escapes in argument 1 */ 
     3537    if (arg1n != (char *) NULL) { 
     3538      arg1=InterpretImageProperties(_image_info,_images,arg1n,_exception); 
     3539      if (arg1 == (char *) NULL) { 
     3540        CLIWandException(OptionWarning,"InterpretPropertyFailure",option); 
     3541        arg1=arg1n;  /* use the given argument as is */ 
     3542      } 
     3543    } 
     3544    if (arg2n != (char *) NULL) { 
     3545      arg2=InterpretImageProperties(_image_info,_images,arg2n,_exception); 
     3546      if (arg2 == (char *) NULL) { 
     3547        CLIWandException(OptionWarning,"InterpretPropertyFailure",option); 
     3548        arg2=arg2n;  /* use the given argument as is */ 
     3549      } 
     3550    } 
     3551  } 
     3552#undef _option_type 
     3553 
     3554#if 0 
     3555  (void) FormatLocaleFile(stderr, 
     3556    "CLIListOperatorImages: \"%s\" \"%s\" \"%s\"\n",option,arg1,arg2); 
     3557#endif 
     3558 
    35173559 
    35183560  new_images=NewImageList(); 
     
    39824024      if (LocaleCompare("print",option+1) == 0) 
    39834025        { 
    3984           char 
    3985             *string; 
    3986  
    3987           string=InterpretImageProperties(_image_info,_images,arg1,_exception); 
    3988           if (string == (char *) NULL) 
    3989             break; 
    3990           (void) FormatLocaleFile(stdout,"%s",string); 
    3991           string=DestroyString(string); 
     4026          (void) FormatLocaleFile(stdout,"%s",arg1); 
    39924027          break; 
    39934028        } 
     
    41934228      CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option); 
    41944229  } 
     4230 
     4231  /* clean up percent escape interpreted strings */ 
     4232  if (arg1 != arg1n ) 
     4233    arg1=DestroyString((char *)arg1); 
     4234  if (arg2 != arg2n ) 
     4235    arg2=DestroyString((char *)arg2); 
     4236 
     4237  /* if new image list generated, replace existing image list */ 
    41954238  if (new_images == (Image *) NULL) 
    41964239    return; 
    4197  
    4198   if (_images != (Image *) NULL) 
    4199     _images=DestroyImageList(_images); 
     4240  _images=DestroyImageList(_images); 
    42004241  _images=GetFirstImageInList(new_images); 
    42014242  return; 
     
    42164257%                                                                             % 
    42174258%                                                                             % 
    4218 +   C L I S p e c i a l O p e r a t i o n s                                   % 
     4259+   C L I N o I m a g e O p e r a t i o n s                                   % 
    42194260%                                                                             % 
    42204261%                                                                             % 
     
    42234264% 
    42244265%  CLINoImageOperator() Applies operations that may not actually need images 
    4225 %  in an image list wen it is applied. 
     4266%  in an image list. 
    42264267% 
    42274268%  The classic operators of this type is -read, which actually creates images 
    42284269%  even when no images are present.  Or image stack operators, which can be 
    4229 %  applied to empty image lists. 
     4270%  applied (push or pop) to an empty image list. 
    42304271% 
    42314272%  Note: unlike other Operators, these may involve other special 'option' 
    4232 %  character prefixes, other than simply '-' or '+'. 
     4273%  characters other than '-' or '+', namely parenthesis and braces. 
    42334274% 
    42344275%  The format of the CLINoImageOption method is: 
     
    43314372        new_images; 
    43324373#if 0 
    4333 fprintf(stderr, "DEBUG: Reading image: \"%s\"\n", argv[i]); 
     4374      fprintf(stderr, "DEBUG: Reading image: \"%s\"\n", argv[i]); 
    43344375#endif 
    43354376      if (IfMagickTrue(_image_info->ping)) 
     
    46144655%                                                                             % 
    46154656%                                                                             % 
    4616 +   C L I O p t i o n O p e r a t i o n s                                     % 
     4657+   C L I O p t i o n                                                         % 
    46174658%                                                                             % 
    46184659%                                                                             % 
     
    46214662% 
    46224663%  CLIOption() Processes the given option using the given CLI Magick Wand. 
     4664%  The option arguments can be variable in number, though at this time no more 
     4665%  that two is actually used by any option (this may change). Excess options 
     4666%  are simply ignored. 
    46234667% 
    46244668%  If the cli_wand->command pointer is non-null, then it is assumed that the 
    46254669%  option has already been search for up from the CommandOptions[] table in 
    4626 %  "MagickCore/options.c" using  GetCommandOptionInfo(), so that any command 
    4627 %  specific options (such as "magick" scripting options, or "display" settings) 
    4628 %  can be handled separatally. 
     4670%  "MagickCore/options.c" using  GetCommandOptionInfo().  If not set this 
     4671%  routine will do the lookup instead. The pointer is reset afterward. 
     4672% 
     4673%  This action allows the caller to lookup and pre-handle any 'special' 
     4674%  options, (such as implicit reads) before calling this general option 
     4675%  handler to deal with 'standard' command line options. 
    46294676% 
    46304677%  The format of the CLIOption method is: 
     
    46384685%     o option: The special option (with any switch char) to process 
    46394686% 
    4640 %     o args: any required arguments for an option 
     4687%     o args: any required arguments for an option (variable number) 
    46414688% 
    46424689%  Example Usage... 
     
    46634710    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",cli_wand->wand.name); 
    46644711 
    4665   if ( cli_wand->command == (const OptionInfo *) NULL ) 
    4666     cli_wand->command = GetCommandOptionInfo(option); 
     4712  do { /* Break Code Block for error handling */ 
     4713 
     4714    /* get information about option */ 
     4715    if ( cli_wand->command == (const OptionInfo *) NULL ) 
     4716      cli_wand->command = GetCommandOptionInfo(option); 
    46674717#if 0 
    4668     (void) FormatLocaleFile(stderr, "CLIOption \"%s\" matched \"%s\"\n", 
    4669           option, cli_wand->command->mnemonic ); 
     4718      (void) FormatLocaleFile(stderr, "CLIOption \"%s\" matched \"%s\"\n", 
     4719            option, cli_wand->command->mnemonic ); 
    46704720#endif 
    4671  
    4672   option_type=(CommandOptionFlags) cli_wand->command->flags; 
    4673  
    4674   if ( option_type == UndefinedOptionFlag ) 
    4675     CLIWandExceptionReturn(OptionFatalError,"UnrecognizedOption",option); 
    4676  
    4677   assert( LocaleCompare(cli_wand->command->mnemonic,option) == 0 ); 
    4678  
    4679   if ((option_type & (SpecialOptionFlag|GenesisOptionFlag)) != 0 ) 
    4680     CLIWandExceptionReturn(OptionFatalError,"InvalidUseOfOption",option); 
    4681  
    4682   if ( (option_type & DeprecateOptionFlag) != 0 ) 
    4683     CLIWandExceptionReturn(OptionError,"DeprecatedOptionNoCode",option); 
    4684  
    4685   if ( IfMagickTrue(CLICatchException(cli_wand, MagickFalse)) ) 
    4686     return; 
    4687  
    4688  
    4689   { size_t 
    4690       count = cli_wand->command->type; 
    4691  
    4692     va_list 
    4693       operands; 
    4694  
    4695     va_start(operands,option); 
    4696  
    4697     arg1=arg2=NULL; 
    4698     if ( count >= 1 ) 
    4699       arg1=(const char *) va_arg(operands, const char *); 
    4700     if ( count >= 2 ) 
    4701       arg2=(const char *) va_arg(operands, const char *); 
    4702  
    4703     va_end(operands); 
     4721    option_type=(CommandOptionFlags) cli_wand->command->flags; 
     4722 
     4723    if ( option_type == UndefinedOptionFlag ) 
     4724      CLIWandExceptionReturn(OptionFatalError,"UnrecognizedOption",option); 
     4725 
     4726    assert( LocaleCompare(cli_wand->command->mnemonic,option) == 0 ); 
     4727 
     4728    /* depreciated options */ 
     4729    if ( (option_type & DeprecateOptionFlag) != 0 ) 
     4730      CLIWandExceptionBreak(OptionError,"DeprecatedOptionNoCode",option); 
     4731 
     4732    /* options that this module does not handle */ 
     4733    if ((option_type & (SpecialOptionFlag|GenesisOptionFlag)) != 0 ) 
     4734      CLIWandExceptionBreak(OptionFatalError,"InvalidUseOfOption",option); 
     4735 
     4736    /* Get argument strings from VarArgs 
     4737      How can you determine arguments is enough was supplied? */ 
     4738    { size_t 
     4739        count = cli_wand->command->type; 
     4740 
     4741      va_list 
     4742        operands; 
     4743 
     4744      va_start(operands,option); 
     4745 
     4746      arg1=arg2=NULL; 
     4747      if ( count >= 1 ) 
     4748        arg1=(const char *) va_arg(operands, const char *); 
     4749      if ( count >= 2 ) 
     4750        arg2=(const char *) va_arg(operands, const char *); 
     4751 
     4752      va_end(operands); 
    47044753 
    47054754#if 0 
    4706     (void) FormatLocaleFile(stderr, 
    4707       "CLIOption: \"%s\"  Count: %ld  Flags: %04x  Args: \"%s\" \"%s\"\n", 
    4708           option,(long) count,option_type,arg1,arg2); 
     4755      (void) FormatLocaleFile(stderr, 
     4756        "CLIOption: \"%s\"  Count: %ld  Flags: %04x  Args: \"%s\" \"%s\"\n", 
     4757            option,(long) count,option_type,arg1,arg2); 
    47094758#endif 
    4710   } 
     4759    } 
     4760 
     4761    /* 
     4762      Call the appropriate option handler 
     4763    */ 
     4764 
     4765    /* FUTURE: this is temporary - get 'settings' to handle distribution of 
     4766      settings to images attributes,proprieties,artifacts */ 
     4767    if ( cli_wand->wand.images != (Image *)NULL ) 
     4768      SyncImagesSettings(cli_wand->wand.image_info,cli_wand->wand.images, 
     4769          cli_wand->wand.exception); 
     4770 
     4771    if ( (option_type & SettingOptionFlags) != 0 ) { 
     4772      CLISettingOptionInfo(cli_wand, option, arg1, arg2); 
     4773      // FUTURE: Sync Specific Settings into Image Properities (not global) 
     4774    } 
     4775 
     4776    /* Operators that do not need images - read, write, stack, clone */ 
     4777    if ( (option_type & NoImageOperatorFlag) != 0) 
     4778      CLINoImageOperator(cli_wand, option, arg1, arg2); 
     4779 
     4780    /* FUTURE: The not a setting part below is a temporary hack due to 
     4781    * some options being both a Setting and a Simple operator. 
     4782    * Specifically -monitor, -depth, and  -colorspace */ 
     4783    if ( cli_wand->wand.images == (Image *)NULL ) 
     4784      if ( ((option_type & (SimpleOperatorFlag|ListOperatorFlag)) != 0 ) && 
     4785          ((option_type & SettingOptionFlags) == 0 ))  /* temp hack */ 
     4786        CLIWandExceptionBreak(OptionError,"NoImagesFound",option); 
     4787 
     4788    /* Operators work on single images, and needs a loop over the images */ 
     4789    if ( (option_type & SimpleOperatorFlag) != 0) 
     4790      CLISimpleOperatorImages(cli_wand, option, arg1, arg2); 
     4791 
     4792    /* Operators that work on the image list as a whole */ 
     4793    if ( (option_type & ListOperatorFlag) != 0 ) 
     4794      CLIListOperatorImages(cli_wand, option, arg1, arg2); 
     4795 
     4796  } while (0);  /* end Break code block */ 
    47114797 
    47124798  cli_wand->command = (const OptionInfo *) NULL; /* prevent re-use later */ 
    4713  
    4714  
    4715   /* 
    4716      Call the appropriate option handler 
    4717   */ 
    4718  
    4719   /* FUTURE: this is temporary - get 'settings' to handle 
    4720      distribution of settings to images attributes,proprieties,artifacts */ 
    4721   if ( cli_wand->wand.images != (Image *)NULL ) 
    4722     SyncImagesSettings(cli_wand->wand.image_info,cli_wand->wand.images, 
    4723         cli_wand->wand.exception); 
    4724  
    4725   if ( (option_type & SettingOptionFlags) != 0 ) { 
    4726     CLISettingOptionInfo(cli_wand, option, arg1, arg2); 
    4727     // FUTURE: Sync Specific Settings into Image Properities (not global) 
    4728   } 
    4729  
    4730   if ( (option_type & NoImageOperatorFlag) != 0) 
    4731     CLINoImageOperator(cli_wand, option, arg1, arg2); 
    4732  
    4733   /* FUTURE: The not a setting part below is a temporary hack due to 
    4734    * some options being both a Setting and a Simple operator. 
    4735    * Specifically -monitor, -depth, and  -colorspace */ 
    4736   if ( cli_wand->wand.images == (Image *)NULL ) { 
    4737     if ( ((option_type & (SimpleOperatorFlag|ListOperatorFlag)) != 0 ) && 
    4738          ((option_type & SettingOptionFlags) == 0 ))  /* temp hack */ 
    4739       CLIWandException(OptionError,"NoImagesFound",option); 
    4740     return; /* on its own this is not an error */ 
    4741   } 
    4742  
    4743   if ( (option_type & SimpleOperatorFlag) != 0) 
    4744     CLISimpleOperatorImages(cli_wand, option, arg1, arg2); 
    4745  
    4746   if ( (option_type & ListOperatorFlag) != 0 ) 
    4747     CLIListOperatorImages(cli_wand, option, arg1, arg2); 
    4748  
    47494799} 
  • ImageMagick/trunk/MagickWand/wandcli-private.h

    r7587 r7954  
    6060typedef enum 
    6161{ 
    62   /* NonOption Handling */ 
    63   ProcessNonOptionImageRead   = 0x0001,  /* A non-option is a image read 
     62  /* General Option Handling */ 
     63  ProcessImplictRead          = 0x0001,  /* Non-options are image reads. 
    6464                                            If not set then skip implied read 
    6565                                            without producing an error. 
    6666                                            For use with "mogrify" handling */ 
     67  ProcessInterpretProperities = 0x0010,  /* allow general escapes in args */ 
    6768 
    6869  /* Special Option Handling */ 
     
    7475  /* Option Processing Flags */ 
    7576  ProcessOneOptionOnly        = 0x4000,  /* Process one option only */ 
    76   ProcessImpliedWrite         = 0x8000,  /* Last arg is an implied write */ 
     77  ProcessImplictWrite         = 0x8000,  /* Last arg is an implict write */ 
    7778 
    7879  /* Flag Groups for specific Situations */ 
    79   MagickCommandOptionFlags    = 0x8F0F,  /* Magick Command Flags */ 
     80  MagickCommandOptionFlags    = 0x8FFF,  /* Magick Command Flags */ 
    8081  ConvertCommandOptionFlags   = 0x800F,  /* Convert Command Flags */ 
    8182  MagickScriptArgsFlags       = 0x000F,  /* Script CLI Process Args Flags */ 
  • ImageMagick/trunk/config/english.xml

    r7899 r7954  
    614614          geometry does not contain image 
    615615        </message> 
     616        <message name="InterpretPropertyFailure"> 
     617          failure in interpret image property escapes 
     618        </message> 
    616619        <message name="InvalidArgument"> 
    617620          invalid argument for option 
     
    942945        <message name="GeometryDoesNotContainImage"> 
    943946          geometry does not contain image 
     947        </message> 
     948        <message name="InterpretPropertyFailure"> 
     949          failure in interpret image property escapes 
    944950        </message> 
    945951        <message name="InvalidSetting"> 
  • ImageMagick/trunk/config/francais.xml

    r7899 r7954  
    608608          image non incluse dans la géométrie 
    609609        </message> 
     610        <message name="InterpretPropertyFailure"> 
     611          *** failure in interpret image property escapes *** 
     612        </message> 
    610613        <message name="InvalidArgument"> 
    611614          argument invalide pour l'option 
     
    933936        <message name="GeometryDoesNotContainImage"> 
    934937          image non incluse dans la géométrie 
     938        </message> 
     939        <message name="InterpretPropertyFailure"> 
     940          *** failure in interpret image property escapes *** 
    935941        </message> 
    936942        <message name="InvalidSetting"> 
Note: See TracChangeset for help on using the changeset viewer.