root / ImageMagick / branches / ImageMagick-6.3.5 / utilities / mogrify.c

Revision 7647, 4.8 kB (checked in by cristy, 15 months ago)
Line 
1/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3%                                                                             %
4%                                                                             %
5%                                                                             %
6%              M   M   OOO    GGGG  RRRR   IIIII  FFFFF  Y   Y                %
7%              MM MM  O   O  G      R   R    I    F       Y Y                 %
8%              M M M  O   O  G GG   RRRRR    I    FFF      Y                  %
9%              M   M  O   O  G   G  R R      I    F        Y                  %
10%              M   M   OOO    GGG   R  R   IIIII  F        Y                  %
11%                                                                             %
12%                                                                             %
13%               Transmogrify an Image or Sequence of Images.                  %
14%                                                                             %
15%                           Software Design                                   %
16%                             John Cristy                                     %
17%                            December 1992                                    %
18%                                                                             %
19%                                                                             %
20%  Copyright 1999-2007 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%  Mogrify transforms an image or a sequence of images. These transforms
37%  include image scaling, image rotation, color reduction, and others. The
38%  transmogrified image overwrites the original image.
39%
40%
41*/
42
43/*
44  Include declarations.
45*/
46#include <stdio.h>
47#include <stdlib.h>
48#include <string.h>
49#include <time.h>
50#include "wand/MagickWand.h"
51#if defined(__WINDOWS__)
52#include <windows.h>
53#endif
54
55/*
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57%                                                                             %
58%                                                                             %
59%                                                                             %
60%  M a i n                                                                    %
61%                                                                             %
62%                                                                             %
63%                                                                             %
64%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65%
66%
67*/
68int main(int argc,char **argv)
69{
70  char
71    *option;
72
73  ExceptionInfo
74    *exception;
75
76  ImageInfo
77    *image_info;
78
79  MagickBooleanType
80    regard_warnings,
81    status;
82
83  register long
84    i;
85
86  MagickCoreGenesis(*argv,MagickTrue);
87  exception=AcquireExceptionInfo();
88  regard_warnings=MagickFalse;
89  for (i=1; i < (long) argc; i++)
90  {
91    option=argv[i];
92    if ((strlen(option) == 1) || ((*option != '-') && (*option != '+')))
93      continue;
94    if (LocaleCompare("debug",option+1) == 0)
95      (void) SetLogEventMask(argv[++i]);
96    if (LocaleCompare("regard-warnings",option+1) == 0)
97      regard_warnings=MagickTrue;
98  }
99  image_info=AcquireImageInfo();
100  status=MogrifyImageCommand(image_info,argc,argv,(char **) NULL,exception);
101  if ((status == MagickFalse) || (exception->severity != UndefinedException))
102    {
103      if ((exception->severity < ErrorException) &&
104          (regard_warnings == MagickFalse))
105        status=MagickTrue;
106      CatchException(exception);
107    }
108  image_info=DestroyImageInfo(image_info);
109  exception=DestroyExceptionInfo(exception);
110  MagickCoreTerminus();
111  return(status == MagickFalse ? 1 : 0);
112}
Note: See TracBrowser for help on using the browser.