blob: 1f18c413cdefad99f3d59e70ac2ff0b79d6a1b68 [file] [log] [blame]
Direct call to ProcessCommandOptions() to process an array of
options minus the command argument. This is the function that
actually splits up the argument array into separate operation
group calls.
Compile with ImageMagick-devlop installed...
gcc -lMagickWand -lMagickCore cli_process.c -o cli_process
Compile and run directly from Source Directory...
gcc -I`pwd` -LMagickWand/.libs -LMagickCore/.libs \
-lMagickWand -lMagickCore $IM_PROG.c -o $IM_PROG
sh ./ $IM_PROG
#include <stdio.h>
#include "MagickCore/studio.h"
#include "MagickWand/MagickWand.h"
int main(int argc, char **argv)
int arg_count;
char *args[] = { "-size", "100x100", "xc:red",
"(", "rose:", "-rotate", "-90", ")",
"+append", "show:", NULL };
for(arg_count = 0; args[arg_count] != (char *) NULL; arg_count++);
cli_wand = AcquireMagickCLI((ImageInfo *) NULL,(ExceptionInfo *) NULL);
ProcessCommandOptions(cli_wand, arg_count, args, 0, MagickCommandOptionFlags);
/* Note use of 'True' to report all exceptions - including non-fatals */
if ( CLICatchException(cli_wand,MagickTrue) != MagickFalse )
fprintf(stderr, "Major Error Detected\n");
cli_wand = DestroyMagickCLI(cli_wand);