]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/conjure.c
Handle short months in png_write_iTIME()
[imagemagick] / MagickWand / conjure.c
index ade0137296df0804e747ddb375954e27e21402e0..354b1c9352a359231342e1849503fea6330bad9e 100644 (file)
 %                     Interpret Magick Scripting Language.                    %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                               December 2001                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2017 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                            %
+%    https://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,          %
@@ -112,9 +112,7 @@ static MagickBooleanType ConjureUsage(void)
       (char *) NULL
     };
 
-  (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
-  (void) printf("Copyright: %s\n",GetMagickCopyright());
-  (void) printf("Features: %s\n\n",GetMagickFeatures());
+  ListMagickVersion(stdout);
   (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
     GetClientName());
   (void) printf("\nImage Settings:\n");
@@ -149,12 +147,13 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
 #define ThrowConjureInvalidArgumentException(option,argument) \
 { \
   (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
-    "InvalidArgument","`%s': %s",option,argument); \
+    "InvalidArgument","'%s': %s",option,argument); \
   DestroyConjure(); \
   return(MagickFalse); \
 }
 
   char
+    filename[MagickPathExtent],
     *option;
 
   Image
@@ -169,11 +168,13 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
   ssize_t
     number_images;
 
+  wand_unreferenced(metadata);
+
   /*
     Set defaults.
   */
   assert(image_info != (ImageInfo *) NULL);
-  assert(image_info->signature == MagickSignature);
+  assert(image_info->signature == MagickCoreSignature);
   if (image_info->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
   assert(exception != (ExceptionInfo *) NULL);
@@ -219,7 +220,7 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
             if (*option == '+')
               break;
             i++;
-            if (i == (ssize_t) (argc-1))
+            if (i == (ssize_t) argc)
               ThrowConjureException(OptionError,"MissingArgument",option);
             if (IsGeometry(argv[i]) == MagickFalse)
               ThrowConjureInvalidArgumentException(option,argv[i]);
@@ -254,7 +255,7 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
             if (*option == '+')
               break;
             i++;
-            if (i == (ssize_t) (argc-1))
+            if (i == (ssize_t) argc)
               ThrowConjureException(OptionError,"MissingArgument",option);
             if (IsGeometry(argv[i]) == MagickFalse)
               ThrowConjureInvalidArgumentException(option,argv[i]);
@@ -268,13 +269,8 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
         if ((LocaleCompare("version",option+1) == 0) ||
             (LocaleCompare("-version",option+1) == 0))
           {
-            (void) FormatLocaleFile(stdout,"Version: %s\n",
-              GetMagickVersion((size_t *) NULL));
-            (void) FormatLocaleFile(stdout,"Copyright: %s\n",
-              GetMagickCopyright());
-            (void) FormatLocaleFile(stdout,"Features: %s\n\n",
-              GetMagickFeatures());
-            return(MagickFalse);
+            ListMagickVersion(stdout);
+            return(MagickTrue);
           }
         /*
           Persist key/value pair.
@@ -293,9 +289,8 @@ WandExport MagickBooleanType ConjureImageCommand(ImageInfo *image_info,
     status=SetImageOption(image_info,"filename",argv[i]);
     if (status == MagickFalse)
       ThrowConjureException(ImageError,"UnableToPersistKey",argv[i]);
-    (void) FormatLocaleString(image_info->filename,MaxTextExtent,"msl:%s",
-      argv[i]);
-    image=ReadImages(image_info,exception);
+    (void) FormatLocaleString(filename,MagickPathExtent,"msl:%s",argv[i]);
+    image=ReadImages(image_info,filename,exception);
     CatchException(exception);
     if (image != (Image *) NULL)
       image=DestroyImageList(image);