% September 1994 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 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 %
#include "MagickWand/studio.h"
#include "MagickWand/MagickWand.h"
#include "MagickWand/mogrify-private.h"
+#include "MagickCore/string-private.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
" 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",
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(
}
#define ThrowIdentifyException(asperity,tag,option) \
{ \
- (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
+ (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"'%s'", \
option); \
DestroyIdentify(); \
return(MagickFalse); \
#define ThrowIdentifyInvalidArgumentException(option,argument) \
{ \
(void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
- "InvalidArgument","`%s': %s",option,argument); \
+ "InvalidArgument","'%s': %s",option,argument); \
DestroyIdentify(); \
return(MagickFalse); \
}
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);
char
*text;
- text=InterpretImageProperties(image_info,image,format);
+ text=InterpretImageProperties(image_info,image,format,exception);
if (text == (char *) NULL)
ThrowIdentifyException(ResourceLimitError,
"MemoryAllocationFailed",GetExceptionMessage(errno));
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)
}
ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
}
+ case '3':
+ {
+ 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)
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]);
}
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)