cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | % % |
cristy | 7e41fe8 | 2010-12-04 23:12:08 +0000 | [diff] [blame] | 20 | % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | |
| 42 | /* |
| 43 | Include declarations. |
| 44 | */ |
cristy | ee67810 | 2011-07-01 23:32:11 +0000 | [diff] [blame] | 45 | #include "MagickWand/studio.h" |
| 46 | #include "MagickWand/MagickWand.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 47 | |
| 48 | /* |
| 49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 50 | % % |
| 51 | % % |
| 52 | % % |
| 53 | % M a i n % |
| 54 | % % |
| 55 | % % |
| 56 | % % |
| 57 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 58 | % |
| 59 | % |
| 60 | */ |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 61 | |
cristy | 9c88feb | 2011-09-21 13:06:09 +0000 | [diff] [blame^] | 62 | static int IdentifyMain(int argc,char **argv) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 63 | { |
| 64 | char |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 65 | *metadata; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 66 | |
| 67 | ExceptionInfo |
| 68 | *exception; |
| 69 | |
| 70 | ImageInfo |
| 71 | *image_info; |
| 72 | |
| 73 | MagickBooleanType |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 74 | status; |
| 75 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 76 | MagickCoreGenesis(*argv,MagickTrue); |
| 77 | exception=AcquireExceptionInfo(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 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); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 85 | exception=DestroyExceptionInfo(exception); |
| 86 | MagickCoreTerminus(); |
cristy | 3980b0d | 2009-10-25 14:37:13 +0000 | [diff] [blame] | 87 | return(status); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 88 | } |
cristy | 66f9c3c | 2011-08-13 17:12:28 +0000 | [diff] [blame] | 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 |