2 Direct call to ProcessCommandOptions() to process an array of
3 options minus the command argument. This is the function that
4 actually splits up the argument array into separate operation
8 Compile with ImageMagick-devlop installed...
10 gcc -lMagickWand -lMagickCore cli_process.c -o cli_process
12 Compile and run directly in Source Directory...
14 IM_PROG=api_examples/cli_process
15 gcc -I`pwd` -LMagickWand/.libs -LMagickCore/.libs \
16 -lMagickWand -lMagickCore $IM_PROG.c -o $IM_PROG
22 #include "MagickCore/studio.h"
23 #include "MagickWand/MagickWand.h"
25 int main(int argc, char **argv)
31 char *args[] = { "-size", "100x100", "xc:red",
32 "(", "rose:", "-rotate", "-90", ")",
33 "+append", "show:", NULL };
35 for(arg_count = 0; args[arg_count] != (char *)NULL; arg_count++);
38 MagickCoreGenesis(argv[0],MagickFalse);
39 cli_wand = AcquireMagickCLI((ImageInfo *)NULL,(ExceptionInfo *)NULL);
41 ProcessCommandOptions(cli_wand, arg_count, args, 0, MagickCommandOptionFlags);
43 /* Note use of 'True' to report all exceptions - including non-fatals */
44 if ( CLICatchException(cli_wand,MagickTrue) != MagickFalse )
45 fprintf(stderr, "Major Error Detected\n");
48 cli_wand = DestroyMagickCLI(cli_wand);