2 Direct call to MagickImageCommand(),
3 which is basically what the "magick" command does via
4 a wrapper function MagickCommandGenesis()
6 Compile with ImageMagick-devlop installed...
8 gcc -lMagickWand -lMagickCore magick_command.c -o magick_command
10 Compile and run directly in Source Directory...
12 IM_PROG=api_examples/magick_command
13 gcc -I`pwd` -LMagickWand/.libs -LMagickCore/.libs \
14 -lMagickWand -lMagickCore $IM_PROG.c -o $IM_PROG
20 #include "MagickCore/studio.h"
21 #include "MagickCore/exception.h"
22 #include "MagickCore/exception-private.h"
23 #include "MagickCore/image.h"
24 #include "MagickWand/MagickWand.h"
25 #include "MagickWand/magick-cli.h"
27 int main(int argc, char **argv)
29 MagickCoreGenesis(argv[0],MagickFalse);
32 MagickBooleanType status;
34 ImageInfo *image_info = AcquireImageInfo();
35 ExceptionInfo *exception = AcquireExceptionInfo();
38 char *args[] = { "magick", "-size", "100x100", "xc:red",
39 "(", "rose:", "-rotate", "-90", ")",
40 "+append", "show:", NULL };
42 for(arg_count = 0; args[arg_count] != (char *)NULL; arg_count++);
44 (void) MagickImageCommand(image_info, arg_count, args, NULL, exception);
46 if (exception->severity != UndefinedException)
48 CatchException(exception);
49 fprintf(stderr, "Major Error Detected\n");
52 image_info=DestroyImageInfo(image_info);
53 exception=DestroyExceptionInfo(exception);