/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % M M AAA GGGG IIIII CCCC K K % % MM MM A A G I C K K % % M M M AAAAA G GGG I C KKK % % M M A A G G I C K K % % M M A A GGGG IIIII CCCC K K % % % % Perform "Magick" on Images via the Command Line Interface % % % % Dragon Computing % % Anthony Thyssen % % January 2012 % % % % % % Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % % obtain a copy of the License at % % % % http://www.imagemagick.org/script/license.php % % % % Unless required by applicable law or agreed to in writing, software % % distributed under the License is distributed on an "AS IS" BASIS, % % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % % See the License for the specific language governing permissions and % % limitations under the License. % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Read CLI arguments, script files, and pipelines, to provide options that % manipulate images from many different formats. % */ /* Include declarations. */ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % M a i n % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % */ static int MagickMain(int argc,char **argv) { ExceptionInfo *exception; ImageInfo *image_info; MagickBooleanType status; MagickCoreGenesis(*argv,MagickTrue); exception=AcquireExceptionInfo(); image_info=AcquireImageInfo(); status=MagickCommandGenesis(image_info,MagickImageCommand,argc,argv, (char **) NULL,exception); image_info=DestroyImageInfo(image_info); exception=DestroyExceptionInfo(exception); MagickCoreTerminus(); return(status == MagickFalse ? 0 : 1); } #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) int main(int argc,char **argv) { register int i; for (i=0; i < argc; i++) if (argv[i] == (char *) NULL) break; if (i < argc) return(-1); return(MagickMain(argc,argv)); } #else int wmain(int argc,wchar_t *argv[]) { char **utf8; int status; register int i; utf8=NTArgvToUTF8(argc,argv); status=MagickMain(argc,utf8); for (i=0; i < argc; i++) utf8[i]=DestroyString(utf8[i]); utf8=(char **) RelinquishMagickMemory(utf8); return(status == MagickFalse ? 0 : 1); } #endif