2
% Copyright (C) 2003 GraphicsMagick Group
3
% Copyright (C) 2002 ImageMagick Studio
5
% This program is covered by multiple licenses, which are described in
6
% Copyright.txt. You should have received a copy of Copyright.txt with this
7
% package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
% GraphicsMagick Driver %
25
% Glenn Randers-Pehrson %
27
% Header Centered By %
33
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35
% Gm is a common wrapper around a set of commands, which include animate,
36
% composite, conjure, convert, display, identify, import, mogrify, and
37
% montage. Please see the manual page gm.1 for detailed usage information.
44
#include "magick/studio.h"
45
#include "magick/attribute.h"
46
#include "magick/command.h"
47
#include "magick/magick.h"
48
#include "magick/utility.h"
49
#include "magick/version.h"
51
static void PrintUsage(void)
53
(void) printf("Version: %.1024s\n",GetMagickVersion((unsigned long *) NULL));
54
(void) printf("Copyright: %.1024s\n\n",GetMagickCopyright());
55
(void) printf("Use:\n\n");
56
(void) printf(" %.1024s help\n\n", SetClientName((char *) NULL));
57
(void) printf("to obtain a list of available subcommands, or\n\n");
58
(void) printf(" %.1024s help 'command'\n\n", SetClientName((char *) NULL));
59
(void) printf("to obtain help information for 'command'\n");
63
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75
int main(int argc,char **argv)
78
command[MaxTextExtent],
90
ReadCommandlLine(argc,&argv);
92
InitializeMagick((char *) NULL);
94
InitializeMagick(argv[0]);
97
(void) SetClientName(argv[0]);
100
Support traditional alternate names for GraphicsMagick subcommands.
102
static const char *command_names [] =
119
GetPathComponent(argv[0],BasePath,command);
120
for (i=0; command_names[i]; i++)
121
if (LocaleCompare(command,command_names[i]) == 0)
124
if (command_names[i])
127
Set command name to alternate name.
140
Skip to subcommand name.
147
GetExceptionInfo(&exception);
148
image_info=CloneImageInfo((ImageInfo *) NULL);
150
status=MagickCommand(image_info,argc,argv,&text,&exception);
151
if (text != (char *) NULL)
153
(void) fputs(text,stdout);
154
(void) fputc('\n',stdout);
155
MagickFreeMemory(text);
157
if (exception.severity != UndefinedException)
158
CatchException(&exception);
159
DestroyImageInfo(image_info);
160
DestroyExceptionInfo(&exception);