]> granicus.if.org Git - imagemagick/blobdiff - utilities/convert.c
(no commit message)
[imagemagick] / utilities / convert.c
index 34788f4e21de2daf16e2d716776c71d3012e15d2..513324c5ca91d23821eb14e5499d99994f56166b 100644 (file)
@@ -17,7 +17,7 @@
 %                                April 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2013 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  %
@@ -47,8 +47,8 @@
 /*
   Include declarations.
 */
-#include "wand/studio.h"
-#include "wand/MagickWand.h"
+#include "MagickWand/studio.h"
+#include "MagickWand/MagickWand.h"
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %
 */
-int main(int argc,char **argv)
-{
-  char
-    *metadata;
 
+static int ConvertMain(int argc,char **argv)
+{
   ExceptionInfo
     *exception;
 
@@ -80,13 +78,36 @@ int main(int argc,char **argv)
   MagickCoreGenesis(*argv,MagickTrue);
   exception=AcquireExceptionInfo();
   image_info=AcquireImageInfo();
-  metadata=(char *) NULL;
   status=MagickCommandGenesis(image_info,ConvertImageCommand,argc,argv,
-    &metadata,exception);
-  if (metadata != (char *) NULL)
-    metadata=DestroyString(metadata);
+    (char **) NULL,exception);
   image_info=DestroyImageInfo(image_info);
   exception=DestroyExceptionInfo(exception);
   MagickCoreTerminus();
   return(status);
 }
+
+#if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
+int main(int argc,char **argv)
+{
+  return(ConvertMain(argc,argv));
+}
+#else
+int wmain(int argc,wchar_t *argv[])
+{
+  char
+    **utf8;
+
+  int
+    status;
+
+  register int
+    i;
+
+  utf8=NTArgvToUTF8(argc,argv);
+  status=ConvertMain(argc,utf8);
+  for (i=0; i < argc; i++)
+    utf8[i]=DestroyString(utf8[i]);
+  utf8=(char **) RelinquishMagickMemory(utf8);
+  return(status);
+}
+#endif