2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % CCCC OOO M M PPPP AAA RRRR EEEEE %
7 % C O O MM MM P P A A R R E %
8 % C O O M M M PPPP AAAAA RRRR EEE %
9 % C O O M M P A A R R E %
10 % CCCC OOO M M P A A R R EEEEE %
13 % Image Comparison Utility %
21 % Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
22 % dedicated to making software imaging solutions freely available. %
24 % You may not use this file except in compliance with the License. You may %
25 % obtain a copy of the License at %
27 % http://www.imagemagick.org/script/license.php %
29 % Unless required by applicable law or agreed to in writing, software %
30 % distributed under the License is distributed on an "AS IS" BASIS, %
31 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
32 % See the License for the specific language governing permissions and %
33 % limitations under the License. %
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 % The compare utility mathematically and visually annotates the difference
38 % between an image and its reconstruction.
45 #include "MagickWand/studio.h"
46 #include "MagickWand/MagickWand.h"
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 static int CompareMain(int argc,char **argv)
79 MagickCoreGenesis(*argv,MagickTrue);
80 exception=AcquireExceptionInfo();
81 image_info=AcquireImageInfo();
82 metadata=(char *) NULL;
83 status=MagickCommandGenesis(image_info,CompareImagesCommand,argc,argv,
85 if (metadata != (char *) NULL)
86 metadata=DestroyString(metadata);
87 option=GetImageOption(image_info,"compare:dissimilar");
88 dissimilar=IsStringTrue(option);
89 image_info=DestroyImageInfo(image_info);
90 exception=DestroyExceptionInfo(exception);
92 if (dissimilar != MagickFalse)
94 return(status == MagickFalse ? 0 : 2);
97 #if !defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
98 int main(int argc,char **argv)
100 return(CompareMain(argc,argv));
103 int wmain(int argc,wchar_t *argv[])
114 utf8=NTArgvToUTF8(argc,argv);
115 status=CompareMain(argc,utf8);
116 for (i=0; i < argc; i++)
117 utf8[i]=DestroyString(utf8[i]);
118 utf8=(char **) RelinquishMagickMemory(utf8);
119 return(status == MagickFalse ? 0 : 1);