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 from 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
16 sh ./magick.sh $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);
33 ImageInfo *image_info = AcquireImageInfo();
34 ExceptionInfo *exception = AcquireExceptionInfo();
37 char *args[] = { "magick", "-size", "100x100", "xc:red",
38 "(", "rose:", "-rotate", "-90", ")",
39 "+append", "show:", NULL };
41 for(arg_count = 0; args[arg_count] != (char *) NULL; arg_count++);
43 (void) MagickImageCommand(image_info, arg_count, args, NULL, exception);
45 if (exception->severity != UndefinedException)
47 CatchException(exception);
48 fprintf(stderr, "Major Error Detected\n");
51 image_info=DestroyImageInfo(image_info);
52 exception=DestroyExceptionInfo(exception);