]> granicus.if.org Git - imagemagick/blob - utilities/identify.c
(no commit message)
[imagemagick] / utilities / identify.c
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %                                                                             %
4 %                                                                             %
5 %                                                                             %
6 %           IIIII  DDDD   EEEEE  N   N  TTTTT  IIIII  FFFFF  Y   Y            %
7 %             I    D   D  E      NN  N    T      I    F       Y Y             %
8 %             I    D   D  EEE    N N N    T      I    FFF      Y              %
9 %             I    D   D  E      N  NN    T      I    F        Y              %
10 %           IIIII  DDDD   EEEEE  N   N    T    IIIII  F        Y              %
11 %                                                                             %
12 %                                                                             %
13 %               Identify an Image Format and Characteristics.                 %
14 %                                                                             %
15 %                           Software Design                                   %
16 %                             John Cristy                                     %
17 %                            September 1994                                   %
18 %                                                                             %
19 %                                                                             %
20 %  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
21 %  dedicated to making software imaging solutions freely available.           %
22 %                                                                             %
23 %  You may not use this file except in compliance with the License.  You may  %
24 %  obtain a copy of the License at                                            %
25 %                                                                             %
26 %    http://www.imagemagick.org/script/license.php                            %
27 %                                                                             %
28 %  Unless required by applicable law or agreed to in writing, software        %
29 %  distributed under the License is distributed on an "AS IS" BASIS,          %
30 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
31 %  See the License for the specific language governing permissions and        %
32 %  limitations under the License.                                             %
33 %                                                                             %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 %
36 %  Identify describes the format and characteristics of one or more image
37 %  files.  It will also report if an image is incomplete or corrupt.
38 %
39 %
40 */
41 \f
42 /*
43   Include declarations.
44 */
45 #include "MagickWand/studio.h"
46 #include "MagickWand/MagickWand.h"
47 \f
48 /*
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 %                                                                             %
51 %                                                                             %
52 %                                                                             %
53 %  M a i n                                                                    %
54 %                                                                             %
55 %                                                                             %
56 %                                                                             %
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 %
59 %
60 */
61
62 static int IdentifyMain(int argc,char **argv)
63 {
64   char
65     *metadata;
66
67   ExceptionInfo
68     *exception;
69
70   ImageInfo
71     *image_info;
72
73   MagickBooleanType
74     status;
75
76   MagickCoreGenesis(*argv,MagickTrue);
77   exception=AcquireExceptionInfo();
78   image_info=AcquireImageInfo();
79   metadata=(char *) NULL;
80   status=MagickCommandGenesis(image_info,IdentifyImageCommand,argc,argv,
81     &metadata,exception);
82   if (metadata != (char *) NULL)
83     metadata=DestroyString(metadata);
84   image_info=DestroyImageInfo(image_info);
85   exception=DestroyExceptionInfo(exception);
86   MagickCoreTerminus();
87   return(status);
88 }
89
90 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__)
91 int main(int argc,char **argv)
92 {
93   return(IdentifyMain(argc,argv));
94 }
95 #else
96 int wmain(int argc,wchar_t *argv[])
97 {
98   char
99     **utf8;
100
101   int
102     status;
103
104   register int
105     i;
106
107   utf8=NTArgvToUTF8(argc,argv);
108   status=IdentifyMain(argc,utf8);
109   for (i=0; i < argc; i++)
110     utf8[i]=DestroyString(utf8[i]);
111   utf8=(char **) RelinquishMagickMemory(utf8);
112   return(status);
113 }
114 #endif