]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/identify.c
Added "+combine {colorspace}"
[imagemagick] / MagickWand / identify.c
index df1c0717285a2eca7d0b0bd0a0ee56dbf1b900c7..bd92053252bdc2277e91ea3356b76e53ad22d0c5 100644 (file)
@@ -17,7 +17,7 @@
 %                            September 1994                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 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  %
@@ -50,6 +50,7 @@
 #include "MagickWand/studio.h"
 #include "MagickWand/MagickWand.h"
 #include "MagickWand/mogrify-private.h"
+#include "MagickCore/string-private.h"
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -117,20 +118,25 @@ static MagickBooleanType IdentifyUsage(void)
       "-authenticate password",
       "                     decipher image with this password",
       "-channel type        apply option to select image channels",
+      "-clip                clip along the first path from the 8BIM profile",
+      "-clip-mask filename  associate a clip mask with the image",
+      "-clip-path id        clip along a named path from the 8BIM profile",
       "-colorspace type     alternate image colorspace",
       "-crop geometry       cut out a rectangular region of the image",
       "-define format:option",
       "                     define one or more image format options",
       "-density geometry    horizontal and vertical density of the image",
       "-depth value         image depth",
+      "-endian type         endianness (MSB or LSB) of the image",
       "-extract geometry    extract area from image",
-      "-features distance   display image features (e.g. contrast, correlation)",
+      "-features distance   analyze image features (e.g. contrast, correlation)",
       "-format \"string\"     output formatted image characteristics",
       "-fuzz distance       colors within this distance are considered equal",
       "-gamma value         of gamma correction",
       "-interlace type      type of image interlacing scheme",
       "-interpolate method  pixel color interpolation method",
       "-limit type value    pixel cache resource limit",
+      "-mask filename       associate a mask with the image",
       "-monitor             monitor progress",
       "-ping                efficiently determine image attributes",
       "-quiet               suppress all warning messages",
@@ -150,9 +156,7 @@ static MagickBooleanType IdentifyUsage(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");
@@ -165,7 +169,7 @@ static MagickBooleanType IdentifyUsage(void)
   for (p=miscellaneous; *p != (char *) NULL; p++)
     (void) printf("  %s\n",*p);
   (void) printf(
-    "\nBy default, the image format of `file' is determined by its magic\n");
+    "\nBy default, the image format of 'file' is determined by its magic\n");
   (void) printf(
     "number.  To specify a particular image format, precede the filename\n");
   (void) printf(
@@ -196,7 +200,7 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
 #define ThrowIdentifyInvalidArgumentException(option,argument) \
 { \
   (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
-    "InvalidArgument","`%s': %s",option,argument); \
+    "InvalidArgument","'%s': %s",option,argument); \
   DestroyIdentify(); \
   return(MagickFalse); \
 }
@@ -243,12 +247,7 @@ WandExport MagickBooleanType IdentifyImageCommand(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());
+          ListMagickVersion(stdout);
           return(MagickFalse);
         }
     }
@@ -312,11 +311,10 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
         filename=argv[i];
         if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
           filename=argv[++i];
-        (void) CopyMagickString(identify_info->filename,filename,MaxTextExtent);
         if (identify_info->ping != MagickFalse)
-          images=PingImages(identify_info,exception);
+          images=PingImages(identify_info,filename,exception);
         else
-          images=ReadImages(identify_info,exception);
+          images=ReadImages(identify_info,filename,exception);
         identify_info=DestroyImageInfo(identify_info);
         status&=(images != (Image *) NULL) &&
           (exception->severity < ErrorException);
@@ -366,10 +364,11 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowIdentifyException(OptionError,"MissingArgument",option);
-            type=ParseCommandOption(MagickAlphaOptions,MagickFalse,argv[i]);
+            type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
+              argv[i]);
             if (type < 0)
-              ThrowIdentifyException(OptionError,"UnrecognizedAlphaChannelType",
-                argv[i]);
+              ThrowIdentifyException(OptionError,
+                "UnrecognizedAlphaChannelOption",argv[i]);
             break;
           }
         if (LocaleCompare("antialias",option+1) == 0)
@@ -414,6 +413,24 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
                 argv[i]);
             break;
           }
+        if (LocaleCompare("clip",option+1) == 0)
+          break;
+        if (LocaleCompare("clip-mask",option+1) == 0)
+          {
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowIdentifyException(OptionError,"MissingArgument",option);
+            break;
+          }
+        if (LocaleCompare("clip-path",option+1) == 0)
+          {
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowIdentifyException(OptionError,"MissingArgument",option);
+            break;
+          }
         if (LocaleCompare("colorspace",option+1) == 0)
           {
             ssize_t
@@ -518,6 +535,27 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
           }
         ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
       }
+      case 'e':
+      {
+        if (LocaleCompare("endian",option+1) == 0)
+          {
+            ssize_t
+              endian;
+
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowIdentifyException(OptionError,"MissingArgument",option);
+            endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
+              argv[i]);
+            if (endian < 0)
+              ThrowIdentifyException(OptionError,"UnrecognizedEndianType",
+                argv[i]);
+            break;
+          }
+        ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
+      }
       case 'f':
       {
         if (LocaleCompare("features",option+1) == 0)
@@ -639,7 +677,7 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
             i++;
             if (i == (ssize_t) argc)
               ThrowIdentifyException(OptionError,"MissingArgument",option);
-            value=InterpretLocaleValue(argv[i],&p);
+            value=StringToDouble(argv[i],&p);
             (void) value;
             if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
               ThrowIdentifyInvalidArgumentException(option,argv[i]);
@@ -678,6 +716,15 @@ WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
       }
       case 'm':
       {
+        if (LocaleCompare("mask",option+1) == 0)
+          {
+            if (*option == '+')
+              break;
+            i++;
+            if (i == (ssize_t) (argc-1))
+              ThrowIdentifyException(OptionError,"MissingArgument",option);
+            break;
+          }
         if (LocaleCompare("matte",option+1) == 0)
           break;
         if (LocaleCompare("monitor",option+1) == 0)