MagickWand 7.1.1
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
deprecate.c
1/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% DDDD EEEEE PPPP RRRR EEEEE CCCC AAA TTTTT EEEEE %
7% D D E P P R R E C A A T E %
8% D D EEE PPPPP RRRR EEE C AAAAA T EEE %
9% D D E P R R E C A A T E %
10% DDDD EEEEE P R R EEEEE CCCC A A T EEEEE %
11% %
12% %
13% MagickWand Deprecated Methods %
14% %
15% Software Design %
16% Cristy %
17% October 2002 %
18% %
19% %
20% Copyright @ 1999 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% https://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%
37%
38*/
39
40/*
41 Include declarations.
42*/
43#include "MagickWand/studio.h"
44#include "MagickWand/MagickWand.h"
45#include "MagickWand/magick-wand-private.h"
46#include "MagickWand/mogrify-private.h"
47#include "MagickWand/wand.h"
48#include "MagickCore/exception-private.h"
49#include "MagickCore/monitor-private.h"
50#include "MagickCore/string-private.h"
51#include "MagickCore/thread-private.h"
52#include "MagickCore/utility-private.h"
53
54#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
55
56/*
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58% %
59% %
60% %
61+ C o n v e r t I m a g e C o m m a n d %
62% %
63% %
64% %
65%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66%
67% ConvertImageCommand() reads one or more images, applies one or more image
68% processing operations, and writes out the image in the same or differing
69% format.
70%
71% The format of the ConvertImageCommand method is:
72%
73% MagickBooleanType ConvertImageCommand(ImageInfo *image_info,int argc,
74% char **argv,char **metadata,ExceptionInfo *exception)
75%
76% A description of each parameter follows:
77%
78% o image_info: the image info.
79%
80% o argc: the number of elements in the argument vector.
81%
82% o argv: A text array containing the command line arguments.
83%
84% o metadata: any metadata is returned here.
85%
86% o exception: return any errors or warnings in this structure.
87%
88*/
89
90static MagickBooleanType ConcatenateImages(int argc,char **argv,
91 ExceptionInfo *exception)
92{
93 FILE
94 *input,
95 *output;
96
97 int
98 c;
99
100 MagickBooleanType
101 status;
102
103 ssize_t
104 i;
105
106 /*
107 Open output file.
108 */
109 output=fopen_utf8(argv[argc-1],"wb");
110 if (output == (FILE *) NULL)
111 {
112 ThrowFileException(exception,FileOpenError,"UnableToOpenFile",
113 argv[argc-1]);
114 return(MagickFalse);
115 }
116 status=MagickTrue;
117 for (i=2; i < (ssize_t) (argc-1); i++)
118 {
119 input=fopen_utf8(argv[i],"rb");
120 if (input == (FILE *) NULL)
121 {
122 ThrowFileException(exception,FileOpenError,"UnableToOpenFile",argv[i]);
123 continue;
124 }
125 for (c=fgetc(input); c != EOF; c=fgetc(input))
126 if (fputc((char) c,output) != c)
127 status=MagickFalse;
128 (void) fclose(input);
129 (void) remove_utf8(argv[i]);
130 }
131 (void) fclose(output);
132 return(status);
133}
134
135static MagickBooleanType ConvertUsage(void)
136{
137 static const char
138 channel_operators[] =
139 " -channel-fx expression\n"
140 " exchange, extract, or transfer one or more image channels\n"
141 " -separate separate an image channel into a grayscale image",
142 miscellaneous[] =
143 " -debug events display copious debugging information\n"
144 " -distribute-cache port\n"
145 " distributed pixel cache spanning one or more servers\n"
146 " -help print program options\n"
147 " -list type print a list of supported option arguments\n"
148 " -log format format of debugging information\n"
149 " -version print version information",
150 operators[] =
151 " -adaptive-blur geometry\n"
152 " adaptively blur pixels; decrease effect near edges\n"
153 " -adaptive-resize geometry\n"
154 " adaptively resize image using 'mesh' interpolation\n"
155 " -adaptive-sharpen geometry\n"
156 " adaptively sharpen pixels; increase effect near edges\n"
157 " -alpha option on, activate, off, deactivate, set, opaque, copy\n"
158 " transparent, extract, background, or shape\n"
159 " -annotate geometry text\n"
160 " annotate the image with text\n"
161 " -auto-gamma automagically adjust gamma level of image\n"
162 " -auto-level automagically adjust color levels of image\n"
163 " -auto-orient automagically orient (rotate) image\n"
164 " -auto-threshold method\n"
165 " automatically perform image thresholding\n"
166 " -bench iterations measure performance\n"
167 " -bilateral-blur geometry\n"
168 " non-linear, edge-preserving, and noise-reducing smoothing filter\n"
169 " -black-threshold value\n"
170 " force all pixels below the threshold into black\n"
171 " -blue-shift factor simulate a scene at nighttime in the moonlight\n"
172 " -blur geometry reduce image noise and reduce detail levels\n"
173 " -border geometry surround image with a border of color\n"
174 " -bordercolor color border color\n"
175 " -brightness-contrast geometry\n"
176 " improve brightness / contrast of the image\n"
177 " -canny geometry detect edges in the image\n"
178 " -cdl filename color correct with a color decision list\n"
179 " -channel mask set the image channel mask\n"
180 " -charcoal radius simulate a charcoal drawing\n"
181 " -chop geometry remove pixels from the image interior\n"
182 " -clahe geometry contrast limited adaptive histogram equalization\n"
183 " -clamp keep pixel values in range (0-QuantumRange)\n"
184 " -colorize value colorize the image with the fill color\n"
185 " -color-matrix matrix apply color correction to the image\n"
186 " -colors value preferred number of colors in the image\n"
187 " -connected-components connectivity\n"
188 " connected-components uniquely labeled\n"
189 " -contrast enhance or reduce the image contrast\n"
190 " -contrast-stretch geometry\n"
191 " improve contrast by 'stretching' the intensity range\n"
192 " -convolve coefficients\n"
193 " apply a convolution kernel to the image\n"
194 " -cycle amount cycle the image colormap\n"
195 " -decipher filename convert cipher pixels to plain pixels\n"
196 " -deskew threshold straighten an image\n"
197 " -despeckle reduce the speckles within an image\n"
198 " -distort method args\n"
199 " distort images according to given method and args\n"
200 " -draw string annotate the image with a graphic primitive\n"
201 " -edge radius apply a filter to detect edges in the image\n"
202 " -encipher filename convert plain pixels to cipher pixels\n"
203 " -emboss radius emboss an image\n"
204 " -enhance apply a digital filter to enhance a noisy image\n"
205 " -equalize perform histogram equalization to an image\n"
206 " -evaluate operator value\n"
207 " evaluate an arithmetic, relational, or logical expression\n"
208 " -extent geometry set the image size\n"
209 " -extract geometry extract area from image\n"
210 " -fft implements the discrete Fourier transform (DFT)\n"
211 " -flip flip image vertically\n"
212 " -floodfill geometry color\n"
213 " floodfill the image with color\n"
214 " -flop flop image horizontally\n"
215 " -frame geometry surround image with an ornamental border\n"
216 " -function name parameters\n"
217 " apply function over image values\n"
218 " -gamma value level of gamma correction\n"
219 " -gaussian-blur geometry\n"
220 " reduce image noise and reduce detail levels\n"
221 " -geometry geometry preferred size or location of the image\n"
222 " -grayscale method convert image to grayscale\n"
223 " -hough-lines geometry\n"
224 " identify lines in the image\n"
225 " -identify identify the format and characteristics of the image\n"
226 " -ift implements the inverse discrete Fourier transform (DFT)\n"
227 " -implode amount implode image pixels about the center\n"
228 " -integral calculate the sum of values (pixel values) in the image\n"
229 " -interpolative-resize geometry\n"
230 " resize image using interpolation\n"
231 " -kmeans geometry K means color reduction\n"
232 " -kuwahara geometry edge preserving noise reduction filter\n"
233 " -lat geometry local adaptive thresholding\n"
234 " -level value adjust the level of image contrast\n"
235 " -level-colors color,color\n"
236 " level image with the given colors\n"
237 " -linear-stretch geometry\n"
238 " improve contrast by 'stretching with saturation'\n"
239 " -liquid-rescale geometry\n"
240 " rescale image with seam-carving\n"
241 " -local-contrast geometry\n"
242 " enhance local contrast\n"
243 " -mean-shift geometry delineate arbitrarily shaped clusters in the image\n"
244 " -median geometry apply a median filter to the image\n"
245 " -mode geometry make each pixel the 'predominant color' of the\n"
246 " neighborhood\n"
247 " -modulate value vary the brightness, saturation, and hue\n"
248 " -monochrome transform image to black and white\n"
249 " -morphology method kernel\n"
250 " apply a morphology method to the image\n"
251 " -motion-blur geometry\n"
252 " simulate motion blur\n"
253 " -negate replace every pixel with its complementary color \n"
254 " -noise geometry add or reduce noise in an image\n"
255 " -normalize transform image to span the full range of colors\n"
256 " -opaque color change this color to the fill color\n"
257 " -ordered-dither NxN\n"
258 " add a noise pattern to the image with specific\n"
259 " amplitudes\n"
260 " -paint radius simulate an oil painting\n"
261 " -perceptible epsilon\n"
262 " pixel value less than |epsilon| become epsilon or\n"
263 " -epsilon\n"
264 " -polaroid angle simulate a Polaroid picture\n"
265 " -posterize levels reduce the image to a limited number of color levels\n"
266 " -profile filename add, delete, or apply an image profile\n"
267 " -quantize colorspace reduce colors in this colorspace\n"
268 " -raise value lighten/darken image edges to create a 3-D effect\n"
269 " -random-threshold low,high\n"
270 " random threshold the image\n"
271 " -range-threshold values\n"
272 " perform either hard or soft thresholding within some range of values in an image\n"
273 " -region geometry apply options to a portion of the image\n"
274 " -render render vector graphics\n"
275 " -resample geometry change the resolution of an image\n"
276 " -reshape geometry reshape the image\n"
277 " -resize geometry resize the image\n"
278 " -roll geometry roll an image vertically or horizontally\n"
279 " -rotate degrees apply Paeth rotation to the image\n"
280 " -rotational-blur angle\n"
281 " rotational blur the image\n"
282 " -sample geometry scale image with pixel sampling\n"
283 " -scale geometry scale the image\n"
284 " -segment values segment an image\n"
285 " -selective-blur geometry\n"
286 " selectively blur pixels within a contrast threshold\n"
287 " -sepia-tone threshold\n"
288 " simulate a sepia-toned photo\n"
289 " -set property value set an image property\n"
290 " -shade degrees shade the image using a distant light source\n"
291 " -shadow geometry simulate an image shadow\n"
292 " -sharpen geometry sharpen the image\n"
293 " -shave geometry shave pixels from the image edges\n"
294 " -shear geometry slide one edge of the image along the X or Y axis\n"
295 " -sigmoidal-contrast geometry\n"
296 " increase the contrast without saturating highlights or\n"
297 " shadows\n"
298 " -sketch geometry simulate a pencil sketch\n"
299 " -solarize threshold negate all pixels above the threshold level\n"
300 " -sort-pixels sort each scanline in ascending order of intensity\n"
301 " -sparse-color method args\n"
302 " fill in a image based on a few color points\n"
303 " -splice geometry splice the background color into the image\n"
304 " -spread radius displace image pixels by a random amount\n"
305 " -statistic type geometry\n"
306 " replace each pixel with corresponding statistic from the\n"
307 " neighborhood\n"
308 " -strip strip image of all profiles and comments\n"
309 " -swirl degrees swirl image pixels about the center\n"
310 " -threshold value threshold the image\n"
311 " -thumbnail geometry create a thumbnail of the image\n"
312 " -tile filename tile image when filling a graphic primitive\n"
313 " -tint value tint the image with the fill color\n"
314 " -transform affine transform image\n"
315 " -transparent color make this color transparent within the image\n"
316 " -transpose flip image vertically and rotate 90 degrees\n"
317 " -transverse flop image horizontally and rotate 270 degrees\n"
318 " -trim trim image edges\n"
319 " -type type image type\n"
320 " -unique-colors discard all but one of any pixel color\n"
321 " -unsharp geometry sharpen the image\n"
322 " -vignette geometry soften the edges of the image in vignette style\n"
323 " -wave geometry alter an image along a sine wave\n"
324 " -wavelet-denoise threshold\n"
325 " removes noise from the image using a wavelet transform\n"
326 " -white-balance automagically adjust white balance of image\n"
327 " -white-threshold value\n"
328 " force all pixels above the threshold into white",
329 sequence_operators[] =
330 " -append append an image sequence\n"
331 " -clut apply a color lookup table to the image\n"
332 " -coalesce merge a sequence of images\n"
333 " -combine combine a sequence of images\n"
334 " -compare mathematically and visually annotate the difference between an image and its reconstruction\n"
335 " -complex operator perform complex mathematics on an image sequence\n"
336 " -composite composite image\n"
337 " -copy geometry offset\n"
338 " copy pixels from one area of an image to another\n"
339 " -crop geometry cut out a rectangular region of the image\n"
340 " -deconstruct break down an image sequence into constituent parts\n"
341 " -evaluate-sequence operator\n"
342 " evaluate an arithmetic, relational, or logical expression\n"
343 " -flatten flatten a sequence of images\n"
344 " -fx expression apply mathematical expression to an image channel(s)\n"
345 " -hald-clut apply a Hald color lookup table to the image\n"
346 " -layers method optimize, merge, or compare image layers\n"
347 " -morph value morph an image sequence\n"
348 " -mosaic create a mosaic from an image sequence\n"
349 " -poly terms build a polynomial from the image sequence and the corresponding\n"
350 " terms (coefficients and degree pairs).\n"
351 " -print string interpret string and print to console\n"
352 " -process arguments process the image with a custom image filter\n"
353 " -smush geometry smush an image sequence together\n"
354 " -write filename write images to this file",
355 settings[] =
356 " -adjoin join images into a single multi-image file\n"
357 " -affine matrix affine transform matrix\n"
358 " -alpha option activate, deactivate, reset, or set the alpha channel\n"
359 " -antialias remove pixel-aliasing\n"
360 " -authenticate password\n"
361 " decipher image with this password\n"
362 " -attenuate value lessen (or intensify) when adding noise to an image\n"
363 " -background color background color\n"
364 " -bias value add bias when convolving an image\n"
365 " -black-point-compensation\n"
366 " use black point compensation\n"
367 " -blue-primary point chromaticity blue primary point\n"
368 " -bordercolor color border color\n"
369 " -caption string assign a caption to an image\n"
370 " -clip clip along the first path from the 8BIM profile\n"
371 " -clip-mask filename associate a clip mask with the image\n"
372 " -clip-path id clip along a named path from the 8BIM profile\n"
373 " -colorspace type alternate image colorspace\n"
374 " -comment string annotate image with comment\n"
375 " -compose operator set image composite operator\n"
376 " -compress type type of pixel compression when writing the image\n"
377 " -define format:option\n"
378 " define one or more image format options\n"
379 " -delay value display the next image after pausing\n"
380 " -density geometry horizontal and vertical density of the image\n"
381 " -depth value image depth\n"
382 " -direction type render text right-to-left or left-to-right\n"
383 " -display server get image or font from this X server\n"
384 " -dispose method layer disposal method\n"
385 " -dither method apply error diffusion to image\n"
386 " -encoding type text encoding type\n"
387 " -endian type endianness (MSB or LSB) of the image\n"
388 " -family name render text with this font family\n"
389 " -features distance analyze image features (e.g. contrast, correlation)\n"
390 " -fill color color to use when filling a graphic primitive\n"
391 " -filter type use this filter when resizing an image\n"
392 " -font name render text with this font\n"
393 " -format \"string\" output formatted image characteristics\n"
394 " -fuzz distance colors within this distance are considered equal\n"
395 " -gravity type horizontal and vertical text placement\n"
396 " -green-primary point chromaticity green primary point\n"
397 " -illuminant type reference illuminant\n"
398 " -intensity method method to generate an intensity value from a pixel\n"
399 " -intent type type of rendering intent when managing the image color\n"
400 " -interlace type type of image interlacing scheme\n"
401 " -interline-spacing value\n"
402 " set the space between two text lines\n"
403 " -interpolate method pixel color interpolation method\n"
404 " -interword-spacing value\n"
405 " set the space between two words\n"
406 " -kerning value set the space between two letters\n"
407 " -label string assign a label to an image\n"
408 " -limit type value pixel cache resource limit\n"
409 " -loop iterations add Netscape loop extension to your GIF animation\n"
410 " -matte store matte channel if the image has one\n"
411 " -mattecolor color frame color\n"
412 " -moments report image moments\n"
413 " -monitor monitor progress\n"
414 " -orient type image orientation\n"
415 " -page geometry size and location of an image canvas (setting)\n"
416 " -ping efficiently determine image attributes\n"
417 " -pointsize value font point size\n"
418 " -precision value maximum number of significant digits to print\n"
419 " -preview type image preview type\n"
420 " -quality value JPEG/MIFF/PNG compression level\n"
421 " -quiet suppress all warning messages\n"
422 " -read-mask filename associate a read mask with the image\n"
423 " -red-primary point chromaticity red primary point\n"
424 " -regard-warnings pay attention to warning messages\n"
425 " -remap filename transform image colors to match this set of colors\n"
426 " -repage geometry size and location of an image canvas\n"
427 " -respect-parentheses settings remain in effect until parenthesis boundary\n"
428 " -sampling-factor geometry\n"
429 " horizontal and vertical sampling factor\n"
430 " -scene value image scene number\n"
431 " -seed value seed a new sequence of pseudo-random numbers\n"
432 " -size geometry width and height of image\n"
433 " -stretch type render text with this font stretch\n"
434 " -stroke color graphic primitive stroke color\n"
435 " -strokewidth value graphic primitive stroke width\n"
436 " -style type render text with this font style\n"
437 " -support factor resize support: > 1.0 is blurry, < 1.0 is sharp\n"
438 " -synchronize synchronize image to storage device\n"
439 " -taint declare the image as modified\n"
440 " -texture filename name of texture to tile onto the image background\n"
441 " -tile-offset geometry\n"
442 " tile offset\n"
443 " -treedepth value color tree depth\n"
444 " -transparent-color color\n"
445 " transparent color\n"
446 " -undercolor color annotation bounding box color\n"
447 " -units type the units of image resolution\n"
448 " -verbose print detailed information about the image\n"
449 " -view FlashPix viewing transforms\n"
450 " -virtual-pixel method\n"
451 " virtual pixel access method\n"
452 " -weight type render text with this font weight\n"
453 " -white-point point chromaticity white point\n"
454 " -write-mask filename associate a write mask with the image"
455 " -word-break type sets whether line breaks appear wherever the text would otherwise overflow",
456 stack_operators[] =
457 " -clone indexes clone an image\n"
458 " -delete indexes delete the image from the image sequence\n"
459 " -duplicate count,indexes\n"
460 " duplicate an image one or more times\n"
461 " -insert index insert last image into the image sequence\n"
462 " -reverse reverse image sequence\n"
463 " -swap indexes swap two images in the image sequence";
464
465 ListMagickVersion(stdout);
466 (void) printf("Usage: %s [options ...] file [ [options ...] "
467 "file ...] [options ...] file\n",GetClientName());
468 (void) printf("\nImage Settings:\n");
469 (void) puts(settings);
470 (void) printf("\nImage Operators:\n");
471 (void) puts(operators);
472 (void) printf("\nImage Channel Operators:\n");
473 (void) puts(channel_operators);
474 (void) printf("\nImage Sequence Operators:\n");
475 (void) puts(sequence_operators);
476 (void) printf("\nImage Stack Operators:\n");
477 (void) puts(stack_operators);
478 (void) printf("\nMiscellaneous Options:\n");
479 (void) puts(miscellaneous);
480 (void) printf(
481 "\nBy default, the image format of 'file' is determined by its magic\n");
482 (void) printf(
483 "number. To specify a particular image format, precede the filename\n");
484 (void) printf(
485 "with an image format name and a colon (i.e. ps:image) or specify the\n");
486 (void) printf(
487 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
488 (void) printf("'-' for standard input or output.\n");
489 return(MagickTrue);
490}
491
492WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
493 int argc,char **argv,char **metadata,ExceptionInfo *exception)
494{
495#define NotInitialized (unsigned int) (~0)
496#define DestroyConvert() \
497{ \
498 DestroyImageStack(); \
499 for (i=0; i < (ssize_t) argc; i++) \
500 argv[i]=DestroyString(argv[i]); \
501 argv=(char **) RelinquishMagickMemory(argv); \
502}
503#define ThrowConvertException(asperity,tag,option) \
504{ \
505 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
506 option); \
507 DestroyConvert(); \
508 return(MagickFalse); \
509}
510#define ThrowConvertInvalidArgumentException(option,argument) \
511{ \
512 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
513 "InvalidArgument","'%s': %s",option,argument); \
514 DestroyConvert(); \
515 return(MagickFalse); \
516}
517
518 char
519 *filename,
520 *option;
521
522 const char
523 *format;
524
525 Image
526 *image = (Image *) NULL;
527
529 image_stack[MaxImageStackDepth+1];
530
531 MagickBooleanType
532 fire,
533 pend,
534 respect_parentheses;
535
536 MagickStatusType
537 status;
538
539 ssize_t
540 i;
541
542 ssize_t
543 j,
544 k;
545
546 /*
547 Set defaults.
548 */
549 assert(image_info != (ImageInfo *) NULL);
550 assert(image_info->signature == MagickCoreSignature);
551 assert(exception != (ExceptionInfo *) NULL);
552 if (IsEventLogging() != MagickFalse)
553 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
554 (void) FormatLocaleFile(stderr,"WARNING: %s\n",
555 "The convert command is deprecated in IMv7, use \"magick\" instead of \"convert\" or \"magick convert\"\n");
556 if (argc == 2)
557 {
558 option=argv[1];
559 if ((LocaleCompare("help",option+1) == 0) ||
560 (LocaleCompare("-help",option+1) == 0))
561 return(ConvertUsage());
562 if ((LocaleCompare("version",option+1) == 0) ||
563 (LocaleCompare("-version",option+1) == 0))
564 {
565 ListMagickVersion(stdout);
566 return(MagickTrue);
567 }
568 }
569 if (argc < 3)
570 {
571 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
572 "MissingArgument","%s","");
573 (void) ConvertUsage();
574 return(MagickFalse);
575 }
576 filename=(char *) NULL;
577 format="%w,%h,%m";
578 j=1;
579 k=0;
580 NewImageStack();
581 option=(char *) NULL;
582 pend=MagickFalse;
583 respect_parentheses=MagickFalse;
584 status=MagickTrue;
585 /*
586 Parse command-line arguments.
587 */
588 ReadCommandlLine(argc,&argv);
589 status=ExpandFilenames(&argc,&argv);
590 if (status == MagickFalse)
591 ThrowConvertException(ResourceLimitError,"MemoryAllocationFailed",
592 GetExceptionMessage(errno));
593 if ((argc > 2) && (LocaleCompare("-concatenate",argv[1]) == 0))
594 return(ConcatenateImages(argc,argv,exception));
595 for (i=1; i < (ssize_t) (argc-1); i++)
596 {
597 option=argv[i];
598 if (LocaleCompare(option,"(") == 0)
599 {
600 FireImageStack(MagickTrue,MagickTrue,pend);
601 if (k == MaxImageStackDepth)
602 ThrowConvertException(OptionError,"ParenthesisNestedTooDeeply",
603 option);
604 PushImageStack();
605 continue;
606 }
607 if (LocaleCompare(option,")") == 0)
608 {
609 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
610 if (k == 0)
611 ThrowConvertException(OptionError,"UnableToParseExpression",option);
612 PopImageStack();
613 continue;
614 }
615 if (IsCommandOption(option) == MagickFalse)
616 {
617 Image
618 *images;
619
620 /*
621 Read input image.
622 */
623 FireImageStack(MagickTrue,MagickTrue,pend);
624 filename=argv[i];
625 if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
626 filename=argv[++i];
627 if (image_info->ping != MagickFalse)
628 images=PingImages(image_info,filename,exception);
629 else
630 images=ReadImages(image_info,filename,exception);
631 status&=(MagickStatusType) (images != (Image *) NULL) &&
632 (exception->severity < ErrorException);
633 if (images == (Image *) NULL)
634 continue;
635 AppendImageStack(images);
636 continue;
637 }
638 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
639 switch (*(option+1))
640 {
641 case 'a':
642 {
643 if (LocaleCompare("adaptive-blur",option+1) == 0)
644 {
645 i++;
646 if (i == (ssize_t) argc)
647 ThrowConvertException(OptionError,"MissingArgument",option);
648 if (IsGeometry(argv[i]) == MagickFalse)
649 ThrowConvertInvalidArgumentException(option,argv[i]);
650 break;
651 }
652 if (LocaleCompare("adaptive-resize",option+1) == 0)
653 {
654 i++;
655 if (i == (ssize_t) argc)
656 ThrowConvertException(OptionError,"MissingArgument",option);
657 if (IsGeometry(argv[i]) == MagickFalse)
658 ThrowConvertInvalidArgumentException(option,argv[i]);
659 break;
660 }
661 if (LocaleCompare("adaptive-sharpen",option+1) == 0)
662 {
663 i++;
664 if (i == (ssize_t) argc)
665 ThrowConvertException(OptionError,"MissingArgument",option);
666 if (IsGeometry(argv[i]) == MagickFalse)
667 ThrowConvertInvalidArgumentException(option,argv[i]);
668 break;
669 }
670 if (LocaleCompare("adjoin",option+1) == 0)
671 break;
672 if (LocaleCompare("affine",option+1) == 0)
673 {
674 if (*option == '+')
675 break;
676 i++;
677 if (i == (ssize_t) argc)
678 ThrowConvertException(OptionError,"MissingArgument",option);
679 if (IsGeometry(argv[i]) == MagickFalse)
680 ThrowConvertInvalidArgumentException(option,argv[i]);
681 break;
682 }
683 if (LocaleCompare("alpha",option+1) == 0)
684 {
685 ssize_t
686 type;
687
688 if (*option == '+')
689 break;
690 i++;
691 if (i == (ssize_t) argc)
692 ThrowConvertException(OptionError,"MissingArgument",option);
693 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
694 argv[i]);
695 if (type < 0)
696 ThrowConvertException(OptionError,
697 "UnrecognizedAlphaChannelOption",argv[i]);
698 break;
699 }
700 if (LocaleCompare("annotate",option+1) == 0)
701 {
702 if (*option == '+')
703 break;
704 i++;
705 if (i == (ssize_t) argc)
706 ThrowConvertException(OptionError,"MissingArgument",option);
707 if (IsGeometry(argv[i]) == MagickFalse)
708 ThrowConvertInvalidArgumentException(option,argv[i]);
709 i++;
710 if (i == (ssize_t) argc)
711 ThrowConvertException(OptionError,"MissingArgument",option);
712 break;
713 }
714 if (LocaleCompare("antialias",option+1) == 0)
715 break;
716 if (LocaleCompare("append",option+1) == 0)
717 break;
718 if (LocaleCompare("attenuate",option+1) == 0)
719 {
720 if (*option == '+')
721 break;
722 i++;
723 if (i == (ssize_t) argc)
724 ThrowConvertException(OptionError,"MissingArgument",option);
725 if (IsGeometry(argv[i]) == MagickFalse)
726 ThrowConvertInvalidArgumentException(option,argv[i]);
727 break;
728 }
729 if (LocaleCompare("authenticate",option+1) == 0)
730 {
731 if (*option == '+')
732 break;
733 i++;
734 if (i == (ssize_t) argc)
735 ThrowConvertException(OptionError,"MissingArgument",option);
736 break;
737 }
738 if (LocaleCompare("auto-gamma",option+1) == 0)
739 break;
740 if (LocaleCompare("auto-level",option+1) == 0)
741 break;
742 if (LocaleCompare("auto-orient",option+1) == 0)
743 break;
744 if (LocaleCompare("auto-threshold",option+1) == 0)
745 {
746 ssize_t
747 method;
748
749 if (*option == '+')
750 break;
751 i++;
752 if (i == (ssize_t) argc)
753 ThrowConvertException(OptionError,"MissingArgument",option);
754 method=ParseCommandOption(MagickAutoThresholdOptions,MagickFalse,
755 argv[i]);
756 if (method < 0)
757 ThrowConvertException(OptionError,"UnrecognizedThresholdMethod",
758 argv[i]);
759 break;
760 }
761 if (LocaleCompare("average",option+1) == 0)
762 break;
763 ThrowConvertException(OptionError,"UnrecognizedOption",option)
764 }
765 case 'b':
766 {
767 if (LocaleCompare("background",option+1) == 0)
768 {
769 if (*option == '+')
770 break;
771 i++;
772 if (i == (ssize_t) argc)
773 ThrowConvertException(OptionError,"MissingArgument",option);
774 break;
775 }
776 if (LocaleCompare("bench",option+1) == 0)
777 {
778 if (*option == '+')
779 break;
780 i++;
781 if (i == (ssize_t) argc)
782 ThrowConvertException(OptionError,"MissingArgument",option);
783 if (IsGeometry(argv[i]) == MagickFalse)
784 ThrowConvertInvalidArgumentException(option,argv[i]);
785 break;
786 }
787 if (LocaleCompare("bias",option+1) == 0)
788 {
789 if (*option == '+')
790 break;
791 i++;
792 if (i == (ssize_t) argc)
793 ThrowConvertException(OptionError,"MissingArgument",option);
794 if (IsGeometry(argv[i]) == MagickFalse)
795 ThrowConvertInvalidArgumentException(option,argv[i]);
796 break;
797 }
798 if (LocaleCompare("bilateral-blur",option+1) == 0)
799 {
800 if (*option == '+')
801 break;
802 i++;
803 if (i == (ssize_t) argc)
804 ThrowConvertException(OptionError,"MissingArgument",option);
805 if (IsGeometry(argv[i]) == MagickFalse)
806 ThrowConvertInvalidArgumentException(option,argv[i]);
807 break;
808 }
809 if (LocaleCompare("black-point-compensation",option+1) == 0)
810 break;
811 if (LocaleCompare("black-threshold",option+1) == 0)
812 {
813 if (*option == '+')
814 break;
815 i++;
816 if (i == (ssize_t) argc)
817 ThrowConvertException(OptionError,"MissingArgument",option);
818 if (IsGeometry(argv[i]) == MagickFalse)
819 ThrowConvertInvalidArgumentException(option,argv[i]);
820 break;
821 }
822 if (LocaleCompare("blue-primary",option+1) == 0)
823 {
824 if (*option == '+')
825 break;
826 i++;
827 if (i == (ssize_t) argc)
828 ThrowConvertException(OptionError,"MissingArgument",option);
829 if (IsGeometry(argv[i]) == MagickFalse)
830 ThrowConvertInvalidArgumentException(option,argv[i]);
831 break;
832 }
833 if (LocaleCompare("blue-shift",option+1) == 0)
834 {
835 if (*option == '+')
836 break;
837 i++;
838 if (i == (ssize_t) argc)
839 ThrowConvertException(OptionError,"MissingArgument",option);
840 if (IsGeometry(argv[i]) == MagickFalse)
841 ThrowConvertInvalidArgumentException(option,argv[i]);
842 break;
843 }
844 if (LocaleCompare("blur",option+1) == 0)
845 {
846 if (*option == '+')
847 break;
848 i++;
849 if (i == (ssize_t) argc)
850 ThrowConvertException(OptionError,"MissingArgument",option);
851 if (IsGeometry(argv[i]) == MagickFalse)
852 ThrowConvertInvalidArgumentException(option,argv[i]);
853 break;
854 }
855 if (LocaleCompare("border",option+1) == 0)
856 {
857 if (*option == '+')
858 break;
859 i++;
860 if (i == (ssize_t) argc)
861 ThrowConvertException(OptionError,"MissingArgument",option);
862 if (IsGeometry(argv[i]) == MagickFalse)
863 ThrowConvertInvalidArgumentException(option,argv[i]);
864 break;
865 }
866 if (LocaleCompare("bordercolor",option+1) == 0)
867 {
868 if (*option == '+')
869 break;
870 i++;
871 if (i == (ssize_t) argc)
872 ThrowConvertException(OptionError,"MissingArgument",option);
873 break;
874 }
875 if (LocaleCompare("box",option+1) == 0)
876 {
877 if (*option == '+')
878 break;
879 i++;
880 if (i == (ssize_t) argc)
881 ThrowConvertException(OptionError,"MissingArgument",option);
882 break;
883 }
884 if (LocaleCompare("brightness-contrast",option+1) == 0)
885 {
886 i++;
887 if (i == (ssize_t) argc)
888 ThrowConvertException(OptionError,"MissingArgument",option);
889 if (IsGeometry(argv[i]) == MagickFalse)
890 ThrowConvertInvalidArgumentException(option,argv[i]);
891 break;
892 }
893 ThrowConvertException(OptionError,"UnrecognizedOption",option)
894 }
895 case 'c':
896 {
897 if (LocaleCompare("cache",option+1) == 0)
898 {
899 if (*option == '+')
900 break;
901 i++;
902 if (i == (ssize_t) argc)
903 ThrowConvertException(OptionError,"MissingArgument",option);
904 if (IsGeometry(argv[i]) == MagickFalse)
905 ThrowConvertInvalidArgumentException(option,argv[i]);
906 break;
907 }
908 if (LocaleCompare("canny",option+1) == 0)
909 {
910 if (*option == '+')
911 break;
912 i++;
913 if (i == (ssize_t) argc)
914 ThrowConvertException(OptionError,"MissingArgument",option);
915 if (IsGeometry(argv[i]) == MagickFalse)
916 ThrowConvertInvalidArgumentException(option,argv[i]);
917 break;
918 }
919 if (LocaleCompare("caption",option+1) == 0)
920 {
921 if (*option == '+')
922 break;
923 i++;
924 if (i == (ssize_t) argc)
925 ThrowConvertException(OptionError,"MissingArgument",option);
926 break;
927 }
928 if (LocaleCompare("cdl",option+1) == 0)
929 {
930 if (*option == '+')
931 break;
932 i++;
933 if (i == (ssize_t) argc)
934 ThrowConvertException(OptionError,"MissingArgument",option);
935 break;
936 }
937 if (LocaleCompare("channel",option+1) == 0)
938 {
939 ssize_t
940 channel;
941
942 if (*option == '+')
943 break;
944 i++;
945 if (i == (ssize_t) argc)
946 ThrowConvertException(OptionError,"MissingArgument",option);
947 channel=ParseChannelOption(argv[i]);
948 if (channel < 0)
949 ThrowConvertException(OptionError,"UnrecognizedChannelType",
950 argv[i]);
951 break;
952 }
953 if (LocaleCompare("channel-fx",option+1) == 0)
954 {
955 ssize_t
956 channel;
957
958 if (*option == '+')
959 break;
960 i++;
961 if (i == (ssize_t) argc)
962 ThrowConvertException(OptionError,"MissingArgument",option);
963 channel=ParsePixelChannelOption(argv[i]);
964 if (channel < 0)
965 ThrowConvertException(OptionError,"UnrecognizedChannelType",
966 argv[i]);
967 break;
968 }
969 if (LocaleCompare("charcoal",option+1) == 0)
970 {
971 if (*option == '+')
972 break;
973 i++;
974 if (i == (ssize_t) argc)
975 ThrowConvertException(OptionError,"MissingArgument",option);
976 if (IsGeometry(argv[i]) == MagickFalse)
977 ThrowConvertInvalidArgumentException(option,argv[i]);
978 break;
979 }
980 if (LocaleCompare("chop",option+1) == 0)
981 {
982 if (*option == '+')
983 break;
984 i++;
985 if (i == (ssize_t) argc)
986 ThrowConvertException(OptionError,"MissingArgument",option);
987 if (IsGeometry(argv[i]) == MagickFalse)
988 ThrowConvertInvalidArgumentException(option,argv[i]);
989 break;
990 }
991 if (LocaleCompare("clahe",option+1) == 0)
992 {
993 if (*option == '+')
994 break;
995 i++;
996 if (i == (ssize_t) argc)
997 ThrowConvertException(OptionError,"MissingArgument",option);
998 if (IsGeometry(argv[i]) == MagickFalse)
999 ThrowConvertInvalidArgumentException(option,argv[i]);
1000 break;
1001 }
1002 if (LocaleCompare("clamp",option+1) == 0)
1003 break;
1004 if (LocaleCompare("clip",option+1) == 0)
1005 break;
1006 if (LocaleCompare("clip-mask",option+1) == 0)
1007 {
1008 if (*option == '+')
1009 break;
1010 i++;
1011 if (i == (ssize_t) argc)
1012 ThrowConvertException(OptionError,"MissingArgument",option);
1013 break;
1014 }
1015 if (LocaleCompare("clip-path",option+1) == 0)
1016 {
1017 i++;
1018 if (i == (ssize_t) argc)
1019 ThrowConvertException(OptionError,"MissingArgument",option);
1020 break;
1021 }
1022 if (LocaleCompare("clone",option+1) == 0)
1023 {
1024 Image
1025 *clone_images,
1026 *clone_list;
1027
1028 clone_list=CloneImageList(image,exception);
1029 if (k != 0)
1030 clone_list=CloneImageList(image_stack[k-1].image,exception);
1031 if (clone_list == (Image *) NULL)
1032 ThrowConvertException(ImageError,"ImageSequenceRequired",option);
1033 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
1034 if (*option == '+')
1035 clone_images=CloneImages(clone_list,"-1",exception);
1036 else
1037 {
1038 i++;
1039 if (i == (ssize_t) argc)
1040 ThrowConvertException(OptionError,"MissingArgument",option);
1041 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1042 ThrowConvertInvalidArgumentException(option,argv[i]);
1043 clone_images=CloneImages(clone_list,argv[i],exception);
1044 }
1045 if (clone_images == (Image *) NULL)
1046 ThrowConvertException(OptionError,"NoSuchImage",option);
1047 AppendImageStack(clone_images);
1048 clone_list=DestroyImageList(clone_list);
1049 break;
1050 }
1051 if (LocaleCompare("clut",option+1) == 0)
1052 break;
1053 if (LocaleCompare("coalesce",option+1) == 0)
1054 break;
1055 if (LocaleCompare("colorize",option+1) == 0)
1056 {
1057 if (*option == '+')
1058 break;
1059 i++;
1060 if (i == (ssize_t) argc)
1061 ThrowConvertException(OptionError,"MissingArgument",option);
1062 if (IsGeometry(argv[i]) == MagickFalse)
1063 ThrowConvertInvalidArgumentException(option,argv[i]);
1064 break;
1065 }
1066 if (LocaleCompare("color-matrix",option+1) == 0)
1067 {
1068 KernelInfo
1069 *kernel_info;
1070
1071 if (*option == '+')
1072 break;
1073 i++;
1074 if (i == (ssize_t) argc)
1075 ThrowConvertException(OptionError,"MissingArgument",option);
1076 kernel_info=AcquireKernelInfo(argv[i],exception);
1077 if (kernel_info == (KernelInfo *) NULL)
1078 ThrowConvertInvalidArgumentException(option,argv[i]);
1079 kernel_info=DestroyKernelInfo(kernel_info);
1080 break;
1081 }
1082 if (LocaleCompare("colors",option+1) == 0)
1083 {
1084 if (*option == '+')
1085 break;
1086 i++;
1087 if ((i == (ssize_t) argc) ||
1088 (IsGeometry(argv[i]) == MagickFalse))
1089 ThrowConvertException(OptionError,"MissingArgument",option);
1090 break;
1091 }
1092 if (LocaleCompare("colorspace",option+1) == 0)
1093 {
1094 ssize_t
1095 colorspace;
1096
1097 if (*option == '+')
1098 break;
1099 i++;
1100 if (i == (ssize_t) argc)
1101 ThrowConvertException(OptionError,"MissingArgument",option);
1102 colorspace=ParseCommandOption(MagickColorspaceOptions,
1103 MagickFalse,argv[i]);
1104 if (colorspace < 0)
1105 ThrowConvertException(OptionError,"UnrecognizedColorspace",
1106 argv[i]);
1107 break;
1108 }
1109 if (LocaleCompare("color-threshold",option+1) == 0)
1110 {
1111 if (*option == '+')
1112 break;
1113 i++;
1114 if (i == (ssize_t) argc)
1115 ThrowConvertException(OptionError,"MissingArgument",option);
1116 break;
1117 }
1118 if (LocaleCompare("combine",option+1) == 0)
1119 break;
1120 if (LocaleCompare("comment",option+1) == 0)
1121 {
1122 if (*option == '+')
1123 break;
1124 i++;
1125 if (i == (ssize_t) argc)
1126 ThrowConvertException(OptionError,"MissingArgument",option);
1127 break;
1128 }
1129 if (LocaleCompare("compare",option+1) == 0)
1130 break;
1131 if (LocaleCompare("complex",option+1) == 0)
1132 {
1133 ssize_t
1134 op;
1135
1136 if (*option == '+')
1137 break;
1138 i++;
1139 if (i == (ssize_t) argc)
1140 ThrowConvertException(OptionError,"MissingArgument",option);
1141 op=ParseCommandOption(MagickComplexOptions,MagickFalse,argv[i]);
1142 if (op < 0)
1143 ThrowConvertException(OptionError,"UnrecognizedComplexOperator",
1144 argv[i]);
1145 break;
1146 }
1147 if (LocaleCompare("compose",option+1) == 0)
1148 {
1149 ssize_t
1150 compose;
1151
1152 if (*option == '+')
1153 break;
1154 i++;
1155 if (i == (ssize_t) argc)
1156 ThrowConvertException(OptionError,"MissingArgument",option);
1157 compose=ParseCommandOption(MagickComposeOptions,MagickFalse,
1158 argv[i]);
1159 if (compose < 0)
1160 ThrowConvertException(OptionError,"UnrecognizedComposeOperator",
1161 argv[i]);
1162 break;
1163 }
1164 if (LocaleCompare("composite",option+1) == 0)
1165 break;
1166 if (LocaleCompare("compress",option+1) == 0)
1167 {
1168 ssize_t
1169 compress;
1170
1171 if (*option == '+')
1172 break;
1173 i++;
1174 if (i == (ssize_t) argc)
1175 ThrowConvertException(OptionError,"MissingArgument",option);
1176 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
1177 argv[i]);
1178 if (compress < 0)
1179 ThrowConvertException(OptionError,"UnrecognizedImageCompression",
1180 argv[i]);
1181 break;
1182 }
1183 if (LocaleCompare("concurrent",option+1) == 0)
1184 break;
1185 if (LocaleCompare("connected-components",option+1) == 0)
1186 {
1187 i++;
1188 if (i == (ssize_t) argc)
1189 ThrowConvertException(OptionError,"MissingArgument",option);
1190 if (IsGeometry(argv[i]) == MagickFalse)
1191 ThrowConvertInvalidArgumentException(option,argv[i]);
1192 break;
1193 }
1194 if (LocaleCompare("contrast",option+1) == 0)
1195 break;
1196 if (LocaleCompare("contrast-stretch",option+1) == 0)
1197 {
1198 i++;
1199 if (i == (ssize_t) argc)
1200 ThrowConvertException(OptionError,"MissingArgument",option);
1201 if (IsGeometry(argv[i]) == MagickFalse)
1202 ThrowConvertInvalidArgumentException(option,argv[i]);
1203 break;
1204 }
1205 if (LocaleCompare("convolve",option+1) == 0)
1206 {
1207 KernelInfo
1208 *kernel_info;
1209
1210 if (*option == '+')
1211 break;
1212 i++;
1213 if (i == (ssize_t) argc)
1214 ThrowConvertException(OptionError,"MissingArgument",option);
1215 kernel_info=AcquireKernelInfo(argv[i],exception);
1216 if (kernel_info == (KernelInfo *) NULL)
1217 ThrowConvertInvalidArgumentException(option,argv[i]);
1218 kernel_info=DestroyKernelInfo(kernel_info);
1219 break;
1220 }
1221 if (LocaleCompare("copy",option+1) == 0)
1222 {
1223 if (*option == '+')
1224 break;
1225 i++;
1226 if (i == (ssize_t) argc)
1227 ThrowConvertException(OptionError,"MissingArgument",option);
1228 if (IsGeometry(argv[i]) == MagickFalse)
1229 ThrowConvertInvalidArgumentException(option,argv[i]);
1230 i++;
1231 if (i == (ssize_t) argc)
1232 ThrowConvertException(OptionError,"MissingArgument",option);
1233 if (IsGeometry(argv[i]) == MagickFalse)
1234 ThrowConvertInvalidArgumentException(option,argv[i]);
1235 break;
1236 }
1237 if (LocaleCompare("crop",option+1) == 0)
1238 {
1239 if (*option == '+')
1240 break;
1241 i++;
1242 if (i == (ssize_t) argc)
1243 ThrowConvertException(OptionError,"MissingArgument",option);
1244 if (IsGeometry(argv[i]) == MagickFalse)
1245 ThrowConvertInvalidArgumentException(option,argv[i]);
1246 break;
1247 }
1248 if (LocaleCompare("cycle",option+1) == 0)
1249 {
1250 if (*option == '+')
1251 break;
1252 i++;
1253 if (i == (ssize_t) argc)
1254 ThrowConvertException(OptionError,"MissingArgument",option);
1255 if (IsGeometry(argv[i]) == MagickFalse)
1256 ThrowConvertInvalidArgumentException(option,argv[i]);
1257 break;
1258 }
1259 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1260 }
1261 case 'd':
1262 {
1263 if (LocaleCompare("decipher",option+1) == 0)
1264 {
1265 if (*option == '+')
1266 break;
1267 i++;
1268 if (i == (ssize_t) argc)
1269 ThrowConvertException(OptionError,"MissingArgument",option);
1270 break;
1271 }
1272 if (LocaleCompare("deconstruct",option+1) == 0)
1273 break;
1274 if (LocaleCompare("debug",option+1) == 0)
1275 {
1276 ssize_t
1277 event;
1278
1279 if (*option == '+')
1280 break;
1281 i++;
1282 if (i == (ssize_t) argc)
1283 ThrowConvertException(OptionError,"MissingArgument",option);
1284 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
1285 if (event < 0)
1286 ThrowConvertException(OptionError,"UnrecognizedEventType",
1287 argv[i]);
1288 (void) SetLogEventMask(argv[i]);
1289 break;
1290 }
1291 if (LocaleCompare("define",option+1) == 0)
1292 {
1293 i++;
1294 if (i == (ssize_t) argc)
1295 ThrowConvertException(OptionError,"MissingArgument",option);
1296 if (*option == '+')
1297 {
1298 const char
1299 *define;
1300
1301 define=GetImageOption(image_info,argv[i]);
1302 if (define == (const char *) NULL)
1303 ThrowConvertException(OptionError,"NoSuchOption",argv[i]);
1304 break;
1305 }
1306 break;
1307 }
1308 if (LocaleCompare("delay",option+1) == 0)
1309 {
1310 if (*option == '+')
1311 break;
1312 i++;
1313 if (i == (ssize_t) argc)
1314 ThrowConvertException(OptionError,"MissingArgument",option);
1315 if (IsGeometry(argv[i]) == MagickFalse)
1316 ThrowConvertInvalidArgumentException(option,argv[i]);
1317 break;
1318 }
1319 if (LocaleCompare("density",option+1) == 0)
1320 {
1321 if (*option == '+')
1322 break;
1323 i++;
1324 if (i == (ssize_t) argc)
1325 ThrowConvertException(OptionError,"MissingArgument",option);
1326 if (IsGeometry(argv[i]) == MagickFalse)
1327 ThrowConvertInvalidArgumentException(option,argv[i]);
1328 break;
1329 }
1330 if (LocaleCompare("depth",option+1) == 0)
1331 {
1332 if (*option == '+')
1333 break;
1334 i++;
1335 if (i == (ssize_t) argc)
1336 ThrowConvertException(OptionError,"MissingArgument",option);
1337 if (IsGeometry(argv[i]) == MagickFalse)
1338 ThrowConvertInvalidArgumentException(option,argv[i]);
1339 break;
1340 }
1341 if (LocaleCompare("delete",option+1) == 0)
1342 {
1343 if (*option == '+')
1344 break;
1345 i++;
1346 if (i == (ssize_t) argc)
1347 ThrowConvertException(OptionError,"MissingArgument",option);
1348 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1349 ThrowConvertInvalidArgumentException(option,argv[i]);
1350 break;
1351 }
1352 if (LocaleCompare("deskew",option+1) == 0)
1353 {
1354 if (*option == '+')
1355 break;
1356 i++;
1357 if (i == (ssize_t) argc)
1358 ThrowConvertException(OptionError,"MissingArgument",option);
1359 if (IsGeometry(argv[i]) == MagickFalse)
1360 ThrowConvertInvalidArgumentException(option,argv[i]);
1361 break;
1362 }
1363 if (LocaleCompare("despeckle",option+1) == 0)
1364 break;
1365 if (LocaleCompare("direction",option+1) == 0)
1366 {
1367 ssize_t
1368 direction;
1369
1370 if (*option == '+')
1371 break;
1372 i++;
1373 if (i == (ssize_t) argc)
1374 ThrowConvertException(OptionError,"MissingArgument",option);
1375 direction=ParseCommandOption(MagickDirectionOptions,MagickFalse,
1376 argv[i]);
1377 if (direction < 0)
1378 ThrowConvertException(OptionError,"UnrecognizedDirectionType",
1379 argv[i]);
1380 break;
1381 }
1382 if (LocaleCompare("display",option+1) == 0)
1383 {
1384 if (*option == '+')
1385 break;
1386 i++;
1387 if (i == (ssize_t) argc)
1388 ThrowConvertException(OptionError,"MissingArgument",option);
1389 break;
1390 }
1391 if (LocaleCompare("dispose",option+1) == 0)
1392 {
1393 ssize_t
1394 dispose;
1395
1396 if (*option == '+')
1397 break;
1398 i++;
1399 if (i == (ssize_t) argc)
1400 ThrowConvertException(OptionError,"MissingArgument",option);
1401 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1402 if (dispose < 0)
1403 ThrowConvertException(OptionError,"UnrecognizedDisposeMethod",
1404 argv[i]);
1405 break;
1406 }
1407 if (LocaleCompare("distort",option+1) == 0)
1408 {
1409 ssize_t
1410 op;
1411
1412 i++;
1413 if (i == (ssize_t) argc)
1414 ThrowConvertException(OptionError,"MissingArgument",option);
1415 op=ParseCommandOption(MagickDistortOptions,MagickFalse,argv[i]);
1416 if (op < 0)
1417 ThrowConvertException(OptionError,"UnrecognizedDistortMethod",
1418 argv[i]);
1419 i++;
1420 if (i == (ssize_t) argc)
1421 ThrowConvertException(OptionError,"MissingArgument",option);
1422 break;
1423 }
1424 if (LocaleCompare("dither",option+1) == 0)
1425 {
1426 ssize_t
1427 method;
1428
1429 if (*option == '+')
1430 break;
1431 i++;
1432 if (i == (ssize_t) argc)
1433 ThrowConvertException(OptionError,"MissingArgument",option);
1434 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1435 if (method < 0)
1436 ThrowConvertException(OptionError,"UnrecognizedDitherMethod",
1437 argv[i]);
1438 break;
1439 }
1440 if (LocaleCompare("draw",option+1) == 0)
1441 {
1442 if (*option == '+')
1443 break;
1444 i++;
1445 if (i == (ssize_t) argc)
1446 ThrowConvertException(OptionError,"MissingArgument",option);
1447 break;
1448 }
1449 if (LocaleCompare("duplicate",option+1) == 0)
1450 {
1451 if (*option == '+')
1452 break;
1453 i++;
1454 if (i == (ssize_t) argc)
1455 ThrowConvertException(OptionError,"MissingArgument",option);
1456 if (IsGeometry(argv[i]) == MagickFalse)
1457 ThrowConvertInvalidArgumentException(option,argv[i]);
1458 break;
1459 }
1460 if (LocaleCompare("duration",option+1) == 0)
1461 {
1462 if (*option == '+')
1463 break;
1464 i++;
1465 if (i == (ssize_t) argc)
1466 ThrowConvertException(OptionError,"MissingArgument",option);
1467 if (IsGeometry(argv[i]) == MagickFalse)
1468 ThrowConvertInvalidArgumentException(option,argv[i]);
1469 break;
1470 }
1471 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1472 }
1473 case 'e':
1474 {
1475 if (LocaleCompare("edge",option+1) == 0)
1476 {
1477 if (*option == '+')
1478 break;
1479 i++;
1480 if (i == (ssize_t) argc)
1481 ThrowConvertException(OptionError,"MissingArgument",option);
1482 if (IsGeometry(argv[i]) == MagickFalse)
1483 ThrowConvertInvalidArgumentException(option,argv[i]);
1484 break;
1485 }
1486 if (LocaleCompare("emboss",option+1) == 0)
1487 {
1488 if (*option == '+')
1489 break;
1490 i++;
1491 if (i == (ssize_t) argc)
1492 ThrowConvertException(OptionError,"MissingArgument",option);
1493 if (IsGeometry(argv[i]) == MagickFalse)
1494 ThrowConvertInvalidArgumentException(option,argv[i]);
1495 break;
1496 }
1497 if (LocaleCompare("encipher",option+1) == 0)
1498 {
1499 if (*option == '+')
1500 break;
1501 i++;
1502 if (i == (ssize_t) argc)
1503 ThrowConvertException(OptionError,"MissingArgument",option);
1504 break;
1505 }
1506 if (LocaleCompare("encoding",option+1) == 0)
1507 {
1508 if (*option == '+')
1509 break;
1510 i++;
1511 if (i == (ssize_t) argc)
1512 ThrowConvertException(OptionError,"MissingArgument",option);
1513 break;
1514 }
1515 if (LocaleCompare("endian",option+1) == 0)
1516 {
1517 ssize_t
1518 endian;
1519
1520 if (*option == '+')
1521 break;
1522 i++;
1523 if (i == (ssize_t) argc)
1524 ThrowConvertException(OptionError,"MissingArgument",option);
1525 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1526 argv[i]);
1527 if (endian < 0)
1528 ThrowConvertException(OptionError,"UnrecognizedEndianType",
1529 argv[i]);
1530 break;
1531 }
1532 if (LocaleCompare("enhance",option+1) == 0)
1533 break;
1534 if (LocaleCompare("equalize",option+1) == 0)
1535 break;
1536 if (LocaleCompare("evaluate",option+1) == 0)
1537 {
1538 ssize_t
1539 op;
1540
1541 if (*option == '+')
1542 break;
1543 i++;
1544 if (i == (ssize_t) argc)
1545 ThrowConvertException(OptionError,"MissingArgument",option);
1546 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1547 if (op < 0)
1548 ThrowConvertException(OptionError,"UnrecognizedEvaluateOperator",
1549 argv[i]);
1550 i++;
1551 if (i == (ssize_t) argc)
1552 ThrowConvertException(OptionError,"MissingArgument",option);
1553 if (IsGeometry(argv[i]) == MagickFalse)
1554 ThrowConvertInvalidArgumentException(option,argv[i]);
1555 break;
1556 }
1557 if (LocaleCompare("evaluate-sequence",option+1) == 0)
1558 {
1559 ssize_t
1560 op;
1561
1562 if (*option == '+')
1563 break;
1564 i++;
1565 if (i == (ssize_t) argc)
1566 ThrowConvertException(OptionError,"MissingArgument",option);
1567 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1568 if (op < 0)
1569 ThrowConvertException(OptionError,"UnrecognizedEvaluateOperator",
1570 argv[i]);
1571 break;
1572 }
1573 if (LocaleCompare("extent",option+1) == 0)
1574 {
1575 if (*option == '+')
1576 break;
1577 i++;
1578 if (i == (ssize_t) argc)
1579 ThrowConvertException(OptionError,"MissingArgument",option);
1580 if (IsGeometry(argv[i]) == MagickFalse)
1581 ThrowConvertInvalidArgumentException(option,argv[i]);
1582 break;
1583 }
1584 if (LocaleCompare("extract",option+1) == 0)
1585 {
1586 if (*option == '+')
1587 break;
1588 i++;
1589 if (i == (ssize_t) argc)
1590 ThrowConvertException(OptionError,"MissingArgument",option);
1591 if (IsGeometry(argv[i]) == MagickFalse)
1592 ThrowConvertInvalidArgumentException(option,argv[i]);
1593 break;
1594 }
1595 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1596 }
1597 case 'f':
1598 {
1599 if (LocaleCompare("family",option+1) == 0)
1600 {
1601 if (*option == '+')
1602 break;
1603 i++;
1604 if (i == (ssize_t) argc)
1605 ThrowConvertException(OptionError,"MissingArgument",option);
1606 break;
1607 }
1608 if (LocaleCompare("features",option+1) == 0)
1609 {
1610 if (*option == '+')
1611 break;
1612 i++;
1613 if (i == (ssize_t) argc)
1614 ThrowConvertException(OptionError,"MissingArgument",option);
1615 if (IsGeometry(argv[i]) == MagickFalse)
1616 ThrowConvertInvalidArgumentException(option,argv[i]);
1617 break;
1618 }
1619 if (LocaleCompare("fft",option+1) == 0)
1620 break;
1621 if (LocaleCompare("fill",option+1) == 0)
1622 {
1623 if (*option == '+')
1624 break;
1625 i++;
1626 if (i == (ssize_t) argc)
1627 ThrowConvertException(OptionError,"MissingArgument",option);
1628 break;
1629 }
1630 if (LocaleCompare("filter",option+1) == 0)
1631 {
1632 ssize_t
1633 filter;
1634
1635 if (*option == '+')
1636 break;
1637 i++;
1638 if (i == (ssize_t) argc)
1639 ThrowConvertException(OptionError,"MissingArgument",option);
1640 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1641 if (filter < 0)
1642 ThrowConvertException(OptionError,"UnrecognizedImageFilter",
1643 argv[i]);
1644 break;
1645 }
1646 if (LocaleCompare("flatten",option+1) == 0)
1647 break;
1648 if (LocaleCompare("flip",option+1) == 0)
1649 break;
1650 if (LocaleCompare("flop",option+1) == 0)
1651 break;
1652 if (LocaleCompare("floodfill",option+1) == 0)
1653 {
1654 if (*option == '+')
1655 break;
1656 i++;
1657 if (i == (ssize_t) argc)
1658 ThrowConvertException(OptionError,"MissingArgument",option);
1659 if (IsGeometry(argv[i]) == MagickFalse)
1660 ThrowConvertInvalidArgumentException(option,argv[i]);
1661 i++;
1662 if (i == (ssize_t) argc)
1663 ThrowConvertException(OptionError,"MissingArgument",option);
1664 break;
1665 }
1666 if (LocaleCompare("font",option+1) == 0)
1667 {
1668 if (*option == '+')
1669 break;
1670 i++;
1671 if (i == (ssize_t) argc)
1672 ThrowConvertException(OptionError,"MissingArgument",option);
1673 break;
1674 }
1675 if (LocaleCompare("format",option+1) == 0)
1676 {
1677 if (*option == '+')
1678 break;
1679 i++;
1680 if (i == (ssize_t) argc)
1681 ThrowConvertException(OptionError,"MissingArgument",option);
1682 format=argv[i];
1683 break;
1684 }
1685 if (LocaleCompare("frame",option+1) == 0)
1686 {
1687 if (*option == '+')
1688 break;
1689 i++;
1690 if (i == (ssize_t) argc)
1691 ThrowConvertException(OptionError,"MissingArgument",option);
1692 if (IsGeometry(argv[i]) == MagickFalse)
1693 ThrowConvertInvalidArgumentException(option,argv[i]);
1694 break;
1695 }
1696 if (LocaleCompare("function",option+1) == 0)
1697 {
1698 ssize_t
1699 op;
1700
1701 if (*option == '+')
1702 break;
1703 i++;
1704 if (i == (ssize_t) argc)
1705 ThrowConvertException(OptionError,"MissingArgument",option);
1706 op=ParseCommandOption(MagickFunctionOptions,MagickFalse,argv[i]);
1707 if (op < 0)
1708 ThrowConvertException(OptionError,"UnrecognizedFunction",argv[i]);
1709 i++;
1710 if (i == (ssize_t) argc)
1711 ThrowConvertException(OptionError,"MissingArgument",option);
1712 break;
1713 }
1714 if (LocaleCompare("fuzz",option+1) == 0)
1715 {
1716 if (*option == '+')
1717 break;
1718 i++;
1719 if (i == (ssize_t) argc)
1720 ThrowConvertException(OptionError,"MissingArgument",option);
1721 if (IsGeometry(argv[i]) == MagickFalse)
1722 ThrowConvertInvalidArgumentException(option,argv[i]);
1723 break;
1724 }
1725 if (LocaleCompare("fx",option+1) == 0)
1726 {
1727 i++;
1728 if (i == (ssize_t) argc)
1729 ThrowConvertException(OptionError,"MissingArgument",option);
1730 break;
1731 }
1732 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1733 }
1734 case 'g':
1735 {
1736 if (LocaleCompare("gamma",option+1) == 0)
1737 {
1738 i++;
1739 if (i == (ssize_t) argc)
1740 ThrowConvertException(OptionError,"MissingArgument",option);
1741 if (IsGeometry(argv[i]) == MagickFalse)
1742 ThrowConvertInvalidArgumentException(option,argv[i]);
1743 break;
1744 }
1745 if ((LocaleCompare("gaussian-blur",option+1) == 0) ||
1746 (LocaleCompare("gaussian",option+1) == 0))
1747 {
1748 i++;
1749 if (i == (ssize_t) argc)
1750 ThrowConvertException(OptionError,"MissingArgument",option);
1751 if (IsGeometry(argv[i]) == MagickFalse)
1752 ThrowConvertInvalidArgumentException(option,argv[i]);
1753 break;
1754 }
1755 if (LocaleCompare("geometry",option+1) == 0)
1756 {
1757 if (*option == '+')
1758 break;
1759 i++;
1760 if (i == (ssize_t) argc)
1761 ThrowConvertException(OptionError,"MissingArgument",option);
1762 if (IsGeometry(argv[i]) == MagickFalse)
1763 ThrowConvertInvalidArgumentException(option,argv[i]);
1764 break;
1765 }
1766 if (LocaleCompare("gravity",option+1) == 0)
1767 {
1768 ssize_t
1769 gravity;
1770
1771 if (*option == '+')
1772 break;
1773 i++;
1774 if (i == (ssize_t) argc)
1775 ThrowConvertException(OptionError,"MissingArgument",option);
1776 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1777 argv[i]);
1778 if (gravity < 0)
1779 ThrowConvertException(OptionError,"UnrecognizedGravityType",
1780 argv[i]);
1781 break;
1782 }
1783 if (LocaleCompare("grayscale",option+1) == 0)
1784 {
1785 ssize_t
1786 method;
1787
1788 if (*option == '+')
1789 break;
1790 i++;
1791 if (i == (ssize_t) argc)
1792 ThrowConvertException(OptionError,"MissingArgument",option);
1793 method=ParseCommandOption(MagickPixelIntensityOptions,MagickFalse,
1794 argv[i]);
1795 if (method < 0)
1796 ThrowConvertException(OptionError,"UnrecognizedIntensityMethod",
1797 argv[i]);
1798 break;
1799 }
1800 if (LocaleCompare("green-primary",option+1) == 0)
1801 {
1802 if (*option == '+')
1803 break;
1804 i++;
1805 if (i == (ssize_t) argc)
1806 ThrowConvertException(OptionError,"MissingArgument",option);
1807 if (IsGeometry(argv[i]) == MagickFalse)
1808 ThrowConvertInvalidArgumentException(option,argv[i]);
1809 break;
1810 }
1811 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1812 }
1813 case 'h':
1814 {
1815 if (LocaleCompare("hald-clut",option+1) == 0)
1816 break;
1817 if ((LocaleCompare("help",option+1) == 0) ||
1818 (LocaleCompare("-help",option+1) == 0))
1819 {
1820 DestroyConvert();
1821 return(ConvertUsage());
1822 }
1823 if (LocaleCompare("hough-lines",option+1) == 0)
1824 {
1825 if (*option == '+')
1826 break;
1827 i++;
1828 if (i == (ssize_t) argc)
1829 ThrowConvertException(OptionError,"MissingArgument",option);
1830 if (IsGeometry(argv[i]) == MagickFalse)
1831 ThrowConvertInvalidArgumentException(option,argv[i]);
1832 break;
1833 }
1834 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1835 }
1836 case 'i':
1837 {
1838 if (LocaleCompare("identify",option+1) == 0)
1839 break;
1840 if (LocaleCompare("ift",option+1) == 0)
1841 break;
1842 if (LocaleCompare("illuminant",option+1) == 0)
1843 {
1844 ssize_t
1845 type;
1846
1847 if (*option == '+')
1848 break;
1849 i++;
1850 if (i == (ssize_t) argc)
1851 ThrowConvertException(OptionError,"MissingArgument",option);
1852 type=ParseCommandOption(MagickIlluminantOptions,MagickFalse,
1853 argv[i]);
1854 if (type < 0)
1855 ThrowConvertException(OptionError,"UnrecognizedIlluminantMethod",
1856 argv[i]);
1857 break;
1858 }
1859 if (LocaleCompare("implode",option+1) == 0)
1860 {
1861 if (*option == '+')
1862 break;
1863 i++;
1864 if (i == (ssize_t) argc)
1865 ThrowConvertException(OptionError,"MissingArgument",option);
1866 if (IsGeometry(argv[i]) == MagickFalse)
1867 ThrowConvertInvalidArgumentException(option,argv[i]);
1868 break;
1869 }
1870 if (LocaleCompare("insert",option+1) == 0)
1871 {
1872 if (*option == '+')
1873 break;
1874 i++;
1875 if (i == (ssize_t) argc)
1876 ThrowConvertException(OptionError,"MissingArgument",option);
1877 if (IsGeometry(argv[i]) == MagickFalse)
1878 ThrowConvertInvalidArgumentException(option,argv[i]);
1879 break;
1880 }
1881 if (LocaleCompare("integral",option+1) == 0)
1882 break;
1883 if (LocaleCompare("intensity",option+1) == 0)
1884 {
1885 ssize_t
1886 intensity;
1887
1888 if (*option == '+')
1889 break;
1890 i++;
1891 if (i == (ssize_t) argc)
1892 ThrowConvertException(OptionError,"MissingArgument",option);
1893 intensity=ParseCommandOption(MagickPixelIntensityOptions,
1894 MagickFalse,argv[i]);
1895 if (intensity < 0)
1896 ThrowConvertException(OptionError,"UnrecognizedIntensityMethod",
1897 argv[i]);
1898 break;
1899 }
1900 if (LocaleCompare("intent",option+1) == 0)
1901 {
1902 ssize_t
1903 intent;
1904
1905 if (*option == '+')
1906 break;
1907 i++;
1908 if (i == (ssize_t) argc)
1909 ThrowConvertException(OptionError,"MissingArgument",option);
1910 intent=ParseCommandOption(MagickIntentOptions,MagickFalse,argv[i]);
1911 if (intent < 0)
1912 ThrowConvertException(OptionError,"UnrecognizedIntentType",argv[i]);
1913 break;
1914 }
1915 if (LocaleCompare("interlace",option+1) == 0)
1916 {
1917 ssize_t
1918 interlace;
1919
1920 if (*option == '+')
1921 break;
1922 i++;
1923 if (i == (ssize_t) argc)
1924 ThrowConvertException(OptionError,"MissingArgument",option);
1925 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1926 argv[i]);
1927 if (interlace < 0)
1928 ThrowConvertException(OptionError,"UnrecognizedInterlaceType",
1929 argv[i]);
1930 break;
1931 }
1932 if (LocaleCompare("interline-spacing",option+1) == 0)
1933 {
1934 if (*option == '+')
1935 break;
1936 i++;
1937 if (i == (ssize_t) argc)
1938 ThrowConvertException(OptionError,"MissingArgument",option);
1939 if (IsGeometry(argv[i]) == MagickFalse)
1940 ThrowConvertInvalidArgumentException(option,argv[i]);
1941 break;
1942 }
1943 if (LocaleCompare("interpolate",option+1) == 0)
1944 {
1945 ssize_t
1946 interpolate;
1947
1948 if (*option == '+')
1949 break;
1950 i++;
1951 if (i == (ssize_t) argc)
1952 ThrowConvertException(OptionError,"MissingArgument",option);
1953 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1954 argv[i]);
1955 if (interpolate < 0)
1956 ThrowConvertException(OptionError,"UnrecognizedInterpolateMethod",
1957 argv[i]);
1958 break;
1959 }
1960 if (LocaleCompare("interword-spacing",option+1) == 0)
1961 {
1962 if (*option == '+')
1963 break;
1964 i++;
1965 if (i == (ssize_t) argc)
1966 ThrowConvertException(OptionError,"MissingArgument",option);
1967 if (IsGeometry(argv[i]) == MagickFalse)
1968 ThrowConvertInvalidArgumentException(option,argv[i]);
1969 break;
1970 }
1971 ThrowConvertException(OptionError,"UnrecognizedOption",option)
1972 }
1973 case 'k':
1974 {
1975 if (LocaleCompare("kerning",option+1) == 0)
1976 {
1977 if (*option == '+')
1978 break;
1979 i++;
1980 if (i == (ssize_t) argc)
1981 ThrowConvertException(OptionError,"MissingArgument",option);
1982 if (IsGeometry(argv[i]) == MagickFalse)
1983 ThrowConvertInvalidArgumentException(option,argv[i]);
1984 break;
1985 }
1986 if (LocaleCompare("kmeans",option+1) == 0)
1987 {
1988 if (*option == '+')
1989 break;
1990 i++;
1991 if (i == (ssize_t) argc)
1992 ThrowConvertException(OptionError,"MissingArgument",option);
1993 if (IsGeometry(argv[i]) == MagickFalse)
1994 ThrowConvertInvalidArgumentException(option,argv[i]);
1995 break;
1996 }
1997 if (LocaleCompare("kuwahara",option+1) == 0)
1998 {
1999 if (*option == '+')
2000 break;
2001 i++;
2002 if (i == (ssize_t) argc)
2003 ThrowConvertException(OptionError,"MissingArgument",option);
2004 if (IsGeometry(argv[i]) == MagickFalse)
2005 ThrowConvertInvalidArgumentException(option,argv[i]);
2006 break;
2007 }
2008 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2009 }
2010 case 'l':
2011 {
2012 if (LocaleCompare("label",option+1) == 0)
2013 {
2014 if (*option == '+')
2015 break;
2016 i++;
2017 if (i == (ssize_t) argc)
2018 ThrowConvertException(OptionError,"MissingArgument",option);
2019 break;
2020 }
2021 if (LocaleCompare("lat",option+1) == 0)
2022 {
2023 if (*option == '+')
2024 break;
2025 i++;
2026 if (i == (ssize_t) argc)
2027 ThrowConvertException(OptionError,"MissingArgument",option);
2028 if (IsGeometry(argv[i]) == MagickFalse)
2029 ThrowConvertInvalidArgumentException(option,argv[i]);
2030 break;
2031 }
2032 if (LocaleCompare("layers",option+1) == 0)
2033 {
2034 ssize_t
2035 type;
2036
2037 if (*option == '+')
2038 break;
2039 i++;
2040 if (i == (ssize_t) argc)
2041 ThrowConvertException(OptionError,"MissingArgument",option);
2042 type=ParseCommandOption(MagickLayerOptions,MagickFalse,argv[i]);
2043 if (type < 0)
2044 ThrowConvertException(OptionError,"UnrecognizedLayerMethod",
2045 argv[i]);
2046 break;
2047 }
2048 if (LocaleCompare("level",option+1) == 0)
2049 {
2050 i++;
2051 if (i == (ssize_t) argc)
2052 ThrowConvertException(OptionError,"MissingArgument",option);
2053 if (IsGeometry(argv[i]) == MagickFalse)
2054 ThrowConvertInvalidArgumentException(option,argv[i]);
2055 break;
2056 }
2057 if (LocaleCompare("level-colors",option+1) == 0)
2058 {
2059 i++;
2060 if (i == (ssize_t) argc)
2061 ThrowConvertException(OptionError,"MissingArgument",option);
2062 break;
2063 }
2064 if (LocaleCompare("limit",option+1) == 0)
2065 {
2066 char
2067 *p;
2068
2069 double
2070 value;
2071
2072 ssize_t
2073 resource;
2074
2075 if (*option == '+')
2076 break;
2077 i++;
2078 if (i == (ssize_t) argc)
2079 ThrowConvertException(OptionError,"MissingArgument",option);
2080 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
2081 argv[i]);
2082 if (resource < 0)
2083 ThrowConvertException(OptionError,"UnrecognizedResourceType",
2084 argv[i]);
2085 i++;
2086 if (i == (ssize_t) argc)
2087 ThrowConvertException(OptionError,"MissingArgument",option);
2088 value=StringToDouble(argv[i],&p);
2089 (void) value;
2090 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
2091 ThrowConvertInvalidArgumentException(option,argv[i]);
2092 break;
2093 }
2094 if (LocaleCompare("linear-stretch",option+1) == 0)
2095 {
2096 i++;
2097 if (i == (ssize_t) argc)
2098 ThrowConvertException(OptionError,"MissingArgument",option);
2099 if (IsGeometry(argv[i]) == MagickFalse)
2100 ThrowConvertInvalidArgumentException(option,argv[i]);
2101 break;
2102 }
2103 if (LocaleCompare("liquid-rescale",option+1) == 0)
2104 {
2105 i++;
2106 if (i == (ssize_t) argc)
2107 ThrowConvertException(OptionError,"MissingArgument",option);
2108 if (IsGeometry(argv[i]) == MagickFalse)
2109 ThrowConvertInvalidArgumentException(option,argv[i]);
2110 break;
2111 }
2112 if (LocaleCompare("list",option+1) == 0)
2113 {
2114 ssize_t
2115 list;
2116
2117 if (*option == '+')
2118 break;
2119 i++;
2120 if (i == (ssize_t) argc)
2121 ThrowConvertException(OptionError,"MissingArgument",option);
2122 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
2123 if (list < 0)
2124 ThrowConvertException(OptionError,"UnrecognizedListType",argv[i]);
2125 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
2126 argv+j,exception);
2127 DestroyConvert();
2128 return(status == 0 ? MagickFalse : MagickTrue);
2129 }
2130 if (LocaleCompare("local-contrast",option+1) == 0)
2131 {
2132 i++;
2133 if (i == (ssize_t)argc)
2134 ThrowConvertException(OptionError, "MissingArgument", option);
2135 if (IsGeometry(argv[i]) == MagickFalse)
2136 ThrowConvertInvalidArgumentException(option,argv[i]);
2137 break;
2138 }
2139 if (LocaleCompare("log",option+1) == 0)
2140 {
2141 if (*option == '+')
2142 break;
2143 i++;
2144 if ((i == (ssize_t) argc) ||
2145 (strchr(argv[i],'%') == (char *) NULL))
2146 ThrowConvertException(OptionError,"MissingArgument",option);
2147 break;
2148 }
2149 if (LocaleCompare("loop",option+1) == 0)
2150 {
2151 if (*option == '+')
2152 break;
2153 i++;
2154 if (i == (ssize_t) argc)
2155 ThrowConvertException(OptionError,"MissingArgument",option);
2156 if (IsGeometry(argv[i]) == MagickFalse)
2157 ThrowConvertInvalidArgumentException(option,argv[i]);
2158 break;
2159 }
2160 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2161 }
2162 case 'm':
2163 {
2164 if (LocaleCompare("magnify",option+1) == 0)
2165 break;
2166 if (LocaleCompare("map",option+1) == 0)
2167 {
2168 if (*option == '+')
2169 break;
2170 i++;
2171 if (i == (ssize_t) argc)
2172 ThrowConvertException(OptionError,"MissingArgument",option);
2173 break;
2174 }
2175 if (LocaleCompare("mask",option+1) == 0)
2176 {
2177 if (*option == '+')
2178 break;
2179 i++;
2180 if (i == (ssize_t) argc)
2181 ThrowConvertException(OptionError,"MissingArgument",option);
2182 break;
2183 }
2184 if (LocaleCompare("matte",option+1) == 0)
2185 break;
2186 if (LocaleCompare("mattecolor",option+1) == 0)
2187 {
2188 if (*option == '+')
2189 break;
2190 i++;
2191 if (i == (ssize_t)argc)
2192 ThrowConvertException(OptionError, "MissingArgument", option);
2193 break;
2194 }
2195 if (LocaleCompare("maximum",option+1) == 0)
2196 break;
2197 if (LocaleCompare("mean-shift",option+1) == 0)
2198 {
2199 if (*option == '+')
2200 break;
2201 i++;
2202 if (i == (ssize_t) argc)
2203 ThrowConvertException(OptionError,"MissingArgument",option);
2204 if (IsGeometry(argv[i]) == MagickFalse)
2205 ThrowConvertInvalidArgumentException(option,argv[i]);
2206 break;
2207 }
2208 if (LocaleCompare("median",option+1) == 0)
2209 {
2210 if (*option == '+')
2211 break;
2212 i++;
2213 if (i == (ssize_t) argc)
2214 ThrowConvertException(OptionError,"MissingArgument",option);
2215 if (IsGeometry(argv[i]) == MagickFalse)
2216 ThrowConvertInvalidArgumentException(option,argv[i]);
2217 break;
2218 }
2219 if (LocaleCompare("metric",option+1) == 0)
2220 {
2221 ssize_t
2222 type;
2223
2224 if (*option == '+')
2225 break;
2226 i++;
2227 if (i == (ssize_t) argc)
2228 ThrowConvertException(OptionError,"MissingArgument",option);
2229 type=ParseCommandOption(MagickMetricOptions,MagickTrue,argv[i]);
2230 if (type < 0)
2231 ThrowConvertException(OptionError,"UnrecognizedMetricType",
2232 argv[i]);
2233 break;
2234 }
2235 if (LocaleCompare("minimum",option+1) == 0)
2236 break;
2237 if (LocaleCompare("mode",option+1) == 0)
2238 {
2239 if (*option == '+')
2240 break;
2241 i++;
2242 if (i == (ssize_t) argc)
2243 ThrowConvertException(OptionError,"MissingArgument",option);
2244 if (IsGeometry(argv[i]) == MagickFalse)
2245 ThrowConvertInvalidArgumentException(option,argv[i]);
2246 break;
2247 }
2248 if (LocaleCompare("modulate",option+1) == 0)
2249 {
2250 if (*option == '+')
2251 break;
2252 i++;
2253 if (i == (ssize_t) argc)
2254 ThrowConvertException(OptionError,"MissingArgument",option);
2255 if (IsGeometry(argv[i]) == MagickFalse)
2256 ThrowConvertInvalidArgumentException(option,argv[i]);
2257 break;
2258 }
2259 if (LocaleCompare("moments",option+1) == 0)
2260 break;
2261 if (LocaleCompare("monitor",option+1) == 0)
2262 break;
2263 if (LocaleCompare("monochrome",option+1) == 0)
2264 break;
2265 if (LocaleCompare("morph",option+1) == 0)
2266 {
2267 if (*option == '+')
2268 break;
2269 i++;
2270 if (i == (ssize_t) argc)
2271 ThrowConvertException(OptionError,"MissingArgument",option);
2272 if (IsGeometry(argv[i]) == MagickFalse)
2273 ThrowConvertInvalidArgumentException(option,argv[i]);
2274 break;
2275 }
2276 if (LocaleCompare("morphology",option+1) == 0)
2277 {
2278 char
2279 token[MagickPathExtent];
2280
2281 KernelInfo
2282 *kernel_info;
2283
2284 ssize_t
2285 op;
2286
2287 i++;
2288 if (i == (ssize_t) argc)
2289 ThrowConvertException(OptionError,"MissingArgument",option);
2290 (void) GetNextToken(argv[i],(const char **) NULL,MagickPathExtent,token);
2291 op=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
2292 if (op < 0)
2293 ThrowConvertException(OptionError,"UnrecognizedMorphologyMethod",
2294 token);
2295 i++;
2296 if (i == (ssize_t) argc)
2297 ThrowConvertException(OptionError,"MissingArgument",option);
2298 kernel_info=AcquireKernelInfo(argv[i],exception);
2299 if (kernel_info == (KernelInfo *) NULL)
2300 ThrowConvertInvalidArgumentException(option,argv[i]);
2301 kernel_info=DestroyKernelInfo(kernel_info);
2302 break;
2303 }
2304 if (LocaleCompare("mosaic",option+1) == 0)
2305 break;
2306 if (LocaleCompare("motion-blur",option+1) == 0)
2307 {
2308 if (*option == '+')
2309 break;
2310 i++;
2311 if (i == (ssize_t) argc)
2312 ThrowConvertException(OptionError,"MissingArgument",option);
2313 if (IsGeometry(argv[i]) == MagickFalse)
2314 ThrowConvertInvalidArgumentException(option,argv[i]);
2315 break;
2316 }
2317 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2318 }
2319 case 'n':
2320 {
2321 if (LocaleCompare("negate",option+1) == 0)
2322 break;
2323 if (LocaleCompare("noise",option+1) == 0)
2324 {
2325 i++;
2326 if (i == (ssize_t) argc)
2327 ThrowConvertException(OptionError,"MissingArgument",option);
2328 if (*option == '+')
2329 {
2330 ssize_t
2331 noise;
2332
2333 noise=ParseCommandOption(MagickNoiseOptions,MagickFalse,
2334 argv[i]);
2335 if (noise < 0)
2336 ThrowConvertException(OptionError,"UnrecognizedNoiseType",
2337 argv[i]);
2338 break;
2339 }
2340 if (IsGeometry(argv[i]) == MagickFalse)
2341 ThrowConvertInvalidArgumentException(option,argv[i]);
2342 break;
2343 }
2344 if (LocaleCompare("noop",option+1) == 0)
2345 break;
2346 if (LocaleCompare("normalize",option+1) == 0)
2347 break;
2348 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2349 }
2350 case 'o':
2351 {
2352 if (LocaleCompare("opaque",option+1) == 0)
2353 {
2354 i++;
2355 if (i == (ssize_t) argc)
2356 ThrowConvertException(OptionError,"MissingArgument",option);
2357 break;
2358 }
2359 if (LocaleCompare("ordered-dither",option+1) == 0)
2360 {
2361 if (*option == '+')
2362 break;
2363 i++;
2364 if (i == (ssize_t) argc)
2365 ThrowConvertException(OptionError,"MissingArgument",option);
2366 break;
2367 }
2368 if (LocaleCompare("orient",option+1) == 0)
2369 {
2370 ssize_t
2371 orientation;
2372
2373 if (*option == '+')
2374 break;
2375 i++;
2376 if (i == (ssize_t) argc)
2377 ThrowConvertException(OptionError,"MissingArgument",option);
2378 orientation=ParseCommandOption(MagickOrientationOptions,
2379 MagickFalse,argv[i]);
2380 if (orientation < 0)
2381 ThrowConvertException(OptionError,"UnrecognizedImageOrientation",
2382 argv[i]);
2383 break;
2384 }
2385 ThrowConvertException(OptionError,"UnrecognizedOption",argv[i])
2386 }
2387 case 'p':
2388 {
2389 if (LocaleCompare("page",option+1) == 0)
2390 {
2391 if (*option == '+')
2392 break;
2393 i++;
2394 if (i == (ssize_t) argc)
2395 ThrowConvertException(OptionError,"MissingArgument",option);
2396 break;
2397 }
2398 if (LocaleCompare("paint",option+1) == 0)
2399 {
2400 if (*option == '+')
2401 break;
2402 i++;
2403 if (i == (ssize_t) argc)
2404 ThrowConvertException(OptionError,"MissingArgument",option);
2405 if (IsGeometry(argv[i]) == MagickFalse)
2406 ThrowConvertInvalidArgumentException(option,argv[i]);
2407 break;
2408 }
2409 if (LocaleCompare("perceptible",option+1) == 0)
2410 {
2411 if (*option == '+')
2412 break;
2413 i++;
2414 if (i == (ssize_t) argc)
2415 ThrowConvertException(OptionError,"MissingArgument",option);
2416 if (IsGeometry(argv[i]) == MagickFalse)
2417 ThrowConvertInvalidArgumentException(option,argv[i]);
2418 break;
2419 }
2420 if (LocaleCompare("ping",option+1) == 0)
2421 break;
2422 if (LocaleCompare("pointsize",option+1) == 0)
2423 {
2424 if (*option == '+')
2425 break;
2426 i++;
2427 if (i == (ssize_t) argc)
2428 ThrowConvertException(OptionError,"MissingArgument",option);
2429 if (IsGeometry(argv[i]) == MagickFalse)
2430 ThrowConvertInvalidArgumentException(option,argv[i]);
2431 break;
2432 }
2433 if (LocaleCompare("polaroid",option+1) == 0)
2434 {
2435 if (*option == '+')
2436 break;
2437 i++;
2438 if (i == (ssize_t) argc)
2439 ThrowConvertException(OptionError,"MissingArgument",option);
2440 if (IsGeometry(argv[i]) == MagickFalse)
2441 ThrowConvertInvalidArgumentException(option,argv[i]);
2442 break;
2443 }
2444 if (LocaleCompare("poly",option+1) == 0)
2445 {
2446 if (*option == '+')
2447 break;
2448 i++;
2449 if (i == (ssize_t) argc)
2450 ThrowConvertException(OptionError,"MissingArgument",option);
2451 if (IsGeometry(argv[i]) == MagickFalse)
2452 ThrowConvertInvalidArgumentException(option,argv[i]);
2453 break;
2454 }
2455 if (LocaleCompare("posterize",option+1) == 0)
2456 {
2457 if (*option == '+')
2458 break;
2459 i++;
2460 if (i == (ssize_t) argc)
2461 ThrowConvertException(OptionError,"MissingArgument",option);
2462 if (IsGeometry(argv[i]) == MagickFalse)
2463 ThrowConvertInvalidArgumentException(option,argv[i]);
2464 break;
2465 }
2466 if (LocaleCompare("precision",option+1) == 0)
2467 {
2468 if (*option == '+')
2469 break;
2470 i++;
2471 if (i == (ssize_t) argc)
2472 ThrowConvertException(OptionError,"MissingArgument",option);
2473 if (IsGeometry(argv[i]) == MagickFalse)
2474 ThrowConvertInvalidArgumentException(option,argv[i]);
2475 break;
2476 }
2477 if (LocaleCompare("preview",option+1) == 0)
2478 {
2479 ssize_t
2480 preview;
2481
2482 if (*option == '+')
2483 break;
2484 i++;
2485 if (i == (ssize_t) argc)
2486 ThrowConvertException(OptionError,"MissingArgument",option);
2487 preview=ParseCommandOption(MagickPreviewOptions,MagickFalse,
2488 argv[i]);
2489 if (preview < 0)
2490 ThrowConvertException(OptionError,"UnrecognizedPreviewType",
2491 argv[i]);
2492 break;
2493 }
2494 if (LocaleCompare("print",option+1) == 0)
2495 {
2496 if (*option == '+')
2497 break;
2498 i++;
2499 if (i == (ssize_t) argc)
2500 ThrowConvertException(OptionError,"MissingArgument",option);
2501 break;
2502 }
2503 if (LocaleCompare("process",option+1) == 0)
2504 {
2505 if (*option == '+')
2506 break;
2507 i++;
2508 if (i == (ssize_t) argc)
2509 ThrowConvertException(OptionError,"MissingArgument",option);
2510 break;
2511 }
2512 if (LocaleCompare("profile",option+1) == 0)
2513 {
2514 i++;
2515 if (i == (ssize_t) argc)
2516 ThrowConvertException(OptionError,"MissingArgument",option);
2517 break;
2518 }
2519 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2520 }
2521 case 'q':
2522 {
2523 if (LocaleCompare("quality",option+1) == 0)
2524 {
2525 if (*option == '+')
2526 break;
2527 i++;
2528 if (i == (ssize_t) argc)
2529 ThrowConvertException(OptionError,"MissingArgument",option);
2530 if (IsGeometry(argv[i]) == MagickFalse)
2531 ThrowConvertInvalidArgumentException(option,argv[i]);
2532 break;
2533 }
2534 if (LocaleCompare("quantize",option+1) == 0)
2535 {
2536 ssize_t
2537 colorspace;
2538
2539 if (*option == '+')
2540 break;
2541 i++;
2542 if (i == (ssize_t) argc)
2543 ThrowConvertException(OptionError,"MissingArgument",option);
2544 colorspace=ParseCommandOption(MagickColorspaceOptions,
2545 MagickFalse,argv[i]);
2546 if (colorspace < 0)
2547 ThrowConvertException(OptionError,"UnrecognizedColorspace",
2548 argv[i]);
2549 break;
2550 }
2551 if (LocaleCompare("quiet",option+1) == 0)
2552 break;
2553 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2554 }
2555 case 'r':
2556 {
2557 if (LocaleCompare("rotational-blur",option+1) == 0)
2558 {
2559 i++;
2560 if (i == (ssize_t) argc)
2561 ThrowConvertException(OptionError,"MissingArgument",option);
2562 if (IsGeometry(argv[i]) == MagickFalse)
2563 ThrowConvertInvalidArgumentException(option,argv[i]);
2564 break;
2565 }
2566 if (LocaleCompare("raise",option+1) == 0)
2567 {
2568 i++;
2569 if (i == (ssize_t) argc)
2570 ThrowConvertException(OptionError,"MissingArgument",option);
2571 if (IsGeometry(argv[i]) == MagickFalse)
2572 ThrowConvertInvalidArgumentException(option,argv[i]);
2573 break;
2574 }
2575 if (LocaleCompare("random-threshold",option+1) == 0)
2576 {
2577 if (*option == '+')
2578 break;
2579 i++;
2580 if (i == (ssize_t) argc)
2581 ThrowConvertException(OptionError,"MissingArgument",option);
2582 if (IsGeometry(argv[i]) == MagickFalse)
2583 ThrowConvertInvalidArgumentException(option,argv[i]);
2584 break;
2585 }
2586 if (LocaleCompare("range-threshold",option+1) == 0)
2587 {
2588 if (*option == '+')
2589 break;
2590 i++;
2591 if (i == (ssize_t) argc)
2592 ThrowConvertException(OptionError,"MissingArgument",option);
2593 if (IsGeometry(argv[i]) == MagickFalse)
2594 ThrowConvertInvalidArgumentException(option,argv[i]);
2595 break;
2596 }
2597 if (LocaleCompare("read-mask",option+1) == 0)
2598 {
2599 if (*option == '+')
2600 break;
2601 i++;
2602 if (i == (ssize_t) argc)
2603 ThrowConvertException(OptionError,"MissingArgument",option);
2604 break;
2605 }
2606 if (LocaleCompare("red-primary",option+1) == 0)
2607 {
2608 if (*option == '+')
2609 break;
2610 i++;
2611 if (i == (ssize_t) argc)
2612 ThrowConvertException(OptionError,"MissingArgument",option);
2613 if (IsGeometry(argv[i]) == MagickFalse)
2614 ThrowConvertInvalidArgumentException(option,argv[i]);
2615 break;
2616 }
2617 if (LocaleCompare("regard-warnings",option+1) == 0)
2618 break;
2619 if (LocaleCompare("region",option+1) == 0)
2620 {
2621 if (*option == '+')
2622 break;
2623 i++;
2624 if (i == (ssize_t) argc)
2625 ThrowConvertException(OptionError,"MissingArgument",option);
2626 if (IsGeometry(argv[i]) == MagickFalse)
2627 ThrowConvertInvalidArgumentException(option,argv[i]);
2628 break;
2629 }
2630 if (LocaleCompare("remap",option+1) == 0)
2631 {
2632 if (*option == '+')
2633 break;
2634 i++;
2635 if (i == (ssize_t) argc)
2636 ThrowConvertException(OptionError,"MissingArgument",option);
2637 break;
2638 }
2639 if (LocaleCompare("render",option+1) == 0)
2640 break;
2641 if (LocaleCompare("repage",option+1) == 0)
2642 {
2643 if (*option == '+')
2644 break;
2645 i++;
2646 if (i == (ssize_t) argc)
2647 ThrowConvertException(OptionError,"MissingArgument",option);
2648 if (IsGeometry(argv[i]) == MagickFalse)
2649 ThrowConvertInvalidArgumentException(option,argv[i]);
2650 break;
2651 }
2652 if (LocaleCompare("resample",option+1) == 0)
2653 {
2654 if (*option == '+')
2655 break;
2656 i++;
2657 if (i == (ssize_t) argc)
2658 ThrowConvertException(OptionError,"MissingArgument",option);
2659 if (IsGeometry(argv[i]) == MagickFalse)
2660 ThrowConvertInvalidArgumentException(option,argv[i]);
2661 break;
2662 }
2663 if (LocaleCompare("reshape",option+1) == 0)
2664 {
2665 if (*option == '+')
2666 break;
2667 i++;
2668 if (i == (ssize_t) argc)
2669 ThrowConvertException(OptionError,"MissingArgument",option);
2670 if (IsGeometry(argv[i]) == MagickFalse)
2671 ThrowConvertInvalidArgumentException(option,argv[i]);
2672 break;
2673 }
2674 if (LocaleCompare("resize",option+1) == 0)
2675 {
2676 if (*option == '+')
2677 break;
2678 i++;
2679 if (i == (ssize_t) argc)
2680 ThrowConvertException(OptionError,"MissingArgument",option);
2681 if (IsGeometry(argv[i]) == MagickFalse)
2682 ThrowConvertInvalidArgumentException(option,argv[i]);
2683 break;
2684 }
2685 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
2686 {
2687 respect_parentheses=(*option == '-') ? MagickTrue : MagickFalse;
2688 break;
2689 }
2690 if (LocaleCompare("reverse",option+1) == 0)
2691 break;
2692 if (LocaleCompare("roll",option+1) == 0)
2693 {
2694 if (*option == '+')
2695 break;
2696 i++;
2697 if (i == (ssize_t) argc)
2698 ThrowConvertException(OptionError,"MissingArgument",option);
2699 if (IsGeometry(argv[i]) == MagickFalse)
2700 ThrowConvertInvalidArgumentException(option,argv[i]);
2701 break;
2702 }
2703 if (LocaleCompare("rotate",option+1) == 0)
2704 {
2705 i++;
2706 if (i == (ssize_t) argc)
2707 ThrowConvertException(OptionError,"MissingArgument",option);
2708 if (IsGeometry(argv[i]) == MagickFalse)
2709 ThrowConvertInvalidArgumentException(option,argv[i]);
2710 break;
2711 }
2712 ThrowConvertException(OptionError,"UnrecognizedOption",option)
2713 }
2714 case 's':
2715 {
2716 if (LocaleCompare("sample",option+1) == 0)
2717 {
2718 if (*option == '+')
2719 break;
2720 i++;
2721 if (i == (ssize_t) argc)
2722 ThrowConvertException(OptionError,"MissingArgument",option);
2723 if (IsGeometry(argv[i]) == MagickFalse)
2724 ThrowConvertInvalidArgumentException(option,argv[i]);
2725 break;
2726 }
2727 if (LocaleCompare("sampling-factor",option+1) == 0)
2728 {
2729 if (*option == '+')
2730 break;
2731 i++;
2732 if (i == (ssize_t) argc)
2733 ThrowConvertException(OptionError,"MissingArgument",option);
2734 if (IsGeometry(argv[i]) == MagickFalse)
2735 ThrowConvertInvalidArgumentException(option,argv[i]);
2736 break;
2737 }
2738 if (LocaleCompare("scale",option+1) == 0)
2739 {
2740 if (*option == '+')
2741 break;
2742 i++;
2743 if (i == (ssize_t) argc)
2744 ThrowConvertException(OptionError,"MissingArgument",option);
2745 if (IsGeometry(argv[i]) == MagickFalse)
2746 ThrowConvertInvalidArgumentException(option,argv[i]);
2747 break;
2748 }
2749 if (LocaleCompare("scene",option+1) == 0)
2750 {
2751 if (*option == '+')
2752 break;
2753 i++;
2754 if (i == (ssize_t) argc)
2755 ThrowConvertException(OptionError,"MissingArgument",option);
2756 if (IsGeometry(argv[i]) == MagickFalse)
2757 ThrowConvertInvalidArgumentException(option,argv[i]);
2758 break;
2759 }
2760 if (LocaleCompare("seed",option+1) == 0)
2761 {
2762 if (*option == '+')
2763 break;
2764 i++;
2765 if (i == (ssize_t) argc)
2766 ThrowConvertException(OptionError,"MissingArgument",option);
2767 if (IsGeometry(argv[i]) == MagickFalse)
2768 ThrowConvertInvalidArgumentException(option,argv[i]);
2769 break;
2770 }
2771 if (LocaleCompare("segment",option+1) == 0)
2772 {
2773 if (*option == '+')
2774 break;
2775 i++;
2776 if (i == (ssize_t) argc)
2777 ThrowConvertException(OptionError,"MissingArgument",option);
2778 if (IsGeometry(argv[i]) == MagickFalse)
2779 ThrowConvertInvalidArgumentException(option,argv[i]);
2780 break;
2781 }
2782 if (LocaleCompare("selective-blur",option+1) == 0)
2783 {
2784 i++;
2785 if (i == (ssize_t) argc)
2786 ThrowConvertException(OptionError,"MissingArgument",option);
2787 if (IsGeometry(argv[i]) == MagickFalse)
2788 ThrowConvertInvalidArgumentException(option,argv[i]);
2789 break;
2790 }
2791 if (LocaleCompare("separate",option+1) == 0)
2792 break;
2793 if (LocaleCompare("sepia-tone",option+1) == 0)
2794 {
2795 if (*option == '+')
2796 break;
2797 i++;
2798 if (i == (ssize_t) argc)
2799 ThrowConvertException(OptionError,"MissingArgument",option);
2800 if (IsGeometry(argv[i]) == MagickFalse)
2801 ThrowConvertInvalidArgumentException(option,argv[i]);
2802 break;
2803 }
2804 if (LocaleCompare("set",option+1) == 0)
2805 {
2806 i++;
2807 if (i == (ssize_t) argc)
2808 ThrowConvertException(OptionError,"MissingArgument",option);
2809 if (*option == '+')
2810 break;
2811 i++;
2812 if (i == (ssize_t) argc)
2813 ThrowConvertException(OptionError,"MissingArgument",option);
2814 break;
2815 }
2816 if (LocaleCompare("shade",option+1) == 0)
2817 {
2818 i++;
2819 if (i == (ssize_t) argc)
2820 ThrowConvertException(OptionError,"MissingArgument",option);
2821 if (IsGeometry(argv[i]) == MagickFalse)
2822 ThrowConvertInvalidArgumentException(option,argv[i]);
2823 break;
2824 }
2825 if (LocaleCompare("shadow",option+1) == 0)
2826 {
2827 if (*option == '+')
2828 break;
2829 i++;
2830 if (i == (ssize_t) argc)
2831 ThrowConvertException(OptionError,"MissingArgument",option);
2832 if (IsGeometry(argv[i]) == MagickFalse)
2833 ThrowConvertInvalidArgumentException(option,argv[i]);
2834 break;
2835 }
2836 if (LocaleCompare("sharpen",option+1) == 0)
2837 {
2838 i++;
2839 if (i == (ssize_t) argc)
2840 ThrowConvertException(OptionError,"MissingArgument",option);
2841 if (IsGeometry(argv[i]) == MagickFalse)
2842 ThrowConvertInvalidArgumentException(option,argv[i]);
2843 break;
2844 }
2845 if (LocaleCompare("shave",option+1) == 0)
2846 {
2847 if (*option == '+')
2848 break;
2849 i++;
2850 if (i == (ssize_t) argc)
2851 ThrowConvertException(OptionError,"MissingArgument",option);
2852 if (IsGeometry(argv[i]) == MagickFalse)
2853 ThrowConvertInvalidArgumentException(option,argv[i]);
2854 break;
2855 }
2856 if (LocaleCompare("shear",option+1) == 0)
2857 {
2858 i++;
2859 if (i == (ssize_t) argc)
2860 ThrowConvertException(OptionError,"MissingArgument",option);
2861 if (IsGeometry(argv[i]) == MagickFalse)
2862 ThrowConvertInvalidArgumentException(option,argv[i]);
2863 break;
2864 }
2865 if (LocaleCompare("sigmoidal-contrast",option+1) == 0)
2866 {
2867 i++;
2868 if (i == (ssize_t) argc)
2869 ThrowConvertException(OptionError,"MissingArgument",option);
2870 if (IsGeometry(argv[i]) == MagickFalse)
2871 ThrowConvertInvalidArgumentException(option,argv[i]);
2872 break;
2873 }
2874 if (LocaleCompare("size",option+1) == 0)
2875 {
2876 if (*option == '+')
2877 break;
2878 i++;
2879 if (i == (ssize_t) argc)
2880 ThrowConvertException(OptionError,"MissingArgument",option);
2881 if (IsGeometry(argv[i]) == MagickFalse)
2882 ThrowConvertInvalidArgumentException(option,argv[i]);
2883 break;
2884 }
2885 if (LocaleCompare("sketch",option+1) == 0)
2886 {
2887 if (*option == '+')
2888 break;
2889 i++;
2890 if (i == (ssize_t) argc)
2891 ThrowConvertException(OptionError,"MissingArgument",option);
2892 if (IsGeometry(argv[i]) == MagickFalse)
2893 ThrowConvertInvalidArgumentException(option,argv[i]);
2894 break;
2895 }
2896 if (LocaleCompare("smush",option+1) == 0)
2897 {
2898 i++;
2899 if (i == (ssize_t) argc)
2900 ThrowConvertException(OptionError,"MissingArgument",option);
2901 if (IsGeometry(argv[i]) == MagickFalse)
2902 ThrowConvertInvalidArgumentException(option,argv[i]);
2903 break;
2904 }
2905 if (LocaleCompare("solarize",option+1) == 0)
2906 {
2907 if (*option == '+')
2908 break;
2909 i++;
2910 if (i == (ssize_t) argc)
2911 ThrowConvertException(OptionError,"MissingArgument",option);
2912 if (IsGeometry(argv[i]) == MagickFalse)
2913 ThrowConvertInvalidArgumentException(option,argv[i]);
2914 break;
2915 }
2916 if (LocaleCompare("sort-pixels",option+1) == 0)
2917 break;
2918 if (LocaleCompare("sparse-color",option+1) == 0)
2919 {
2920 ssize_t
2921 op;
2922
2923 i++;
2924 if (i == (ssize_t) argc)
2925 ThrowConvertException(OptionError,"MissingArgument",option);
2926 op=ParseCommandOption(MagickSparseColorOptions,MagickFalse,argv[i]);
2927 if (op < 0)
2928 ThrowConvertException(OptionError,"UnrecognizedSparseColorMethod",
2929 argv[i]);
2930 i++;
2931 if (i == (ssize_t) argc)
2932 ThrowConvertException(OptionError,"MissingArgument",option);
2933 break;
2934 }
2935 if (LocaleCompare("splice",option+1) == 0)
2936 {
2937 if (*option == '+')
2938 break;
2939 i++;
2940 if (i == (ssize_t) argc)
2941 ThrowConvertException(OptionError,"MissingArgument",option);
2942 if (IsGeometry(argv[i]) == MagickFalse)
2943 ThrowConvertInvalidArgumentException(option,argv[i]);
2944 break;
2945 }
2946 if (LocaleCompare("spread",option+1) == 0)
2947 {
2948 if (*option == '+')
2949 break;
2950 i++;
2951 if ((i == (ssize_t) argc) ||
2952 (IsGeometry(argv[i]) == MagickFalse))
2953 ThrowConvertException(OptionError,"MissingArgument",option);
2954 break;
2955 }
2956 if (LocaleCompare("statistic",option+1) == 0)
2957 {
2958 ssize_t
2959 op;
2960
2961 if (*option == '+')
2962 break;
2963 i++;
2964 if (i == (ssize_t) argc)
2965 ThrowConvertException(OptionError,"MissingArgument",option);
2966 op=ParseCommandOption(MagickStatisticOptions,MagickFalse,argv[i]);
2967 if (op < 0)
2968 ThrowConvertException(OptionError,"UnrecognizedStatisticType",
2969 argv[i]);
2970 i++;
2971 if (i == (ssize_t) argc)
2972 ThrowConvertException(OptionError,"MissingArgument",option);
2973 if (IsGeometry(argv[i]) == MagickFalse)
2974 ThrowConvertInvalidArgumentException(option,argv[i]);
2975 break;
2976 }
2977 if (LocaleCompare("stretch",option+1) == 0)
2978 {
2979 ssize_t
2980 stretch;
2981
2982 if (*option == '+')
2983 break;
2984 i++;
2985 if (i == (ssize_t) argc)
2986 ThrowConvertException(OptionError,"MissingArgument",option);
2987 stretch=ParseCommandOption(MagickStretchOptions,MagickFalse,
2988 argv[i]);
2989 if (stretch < 0)
2990 ThrowConvertException(OptionError,"UnrecognizedStyleType",
2991 argv[i]);
2992 break;
2993 }
2994 if (LocaleCompare("strip",option+1) == 0)
2995 break;
2996 if (LocaleCompare("stroke",option+1) == 0)
2997 {
2998 if (*option == '+')
2999 break;
3000 i++;
3001 if (i == (ssize_t) argc)
3002 ThrowConvertException(OptionError,"MissingArgument",option);
3003 break;
3004 }
3005 if (LocaleCompare("strokewidth",option+1) == 0)
3006 {
3007 if (*option == '+')
3008 break;
3009 i++;
3010 if (i == (ssize_t) argc)
3011 ThrowConvertException(OptionError,"MissingArgument",option);
3012 if (IsGeometry(argv[i]) == MagickFalse)
3013 ThrowConvertInvalidArgumentException(option,argv[i]);
3014 break;
3015 }
3016 if (LocaleCompare("style",option+1) == 0)
3017 {
3018 ssize_t
3019 style;
3020
3021 if (*option == '+')
3022 break;
3023 i++;
3024 if (i == (ssize_t) argc)
3025 ThrowConvertException(OptionError,"MissingArgument",option);
3026 style=ParseCommandOption(MagickStyleOptions,MagickFalse,argv[i]);
3027 if (style < 0)
3028 ThrowConvertException(OptionError,"UnrecognizedStyleType",
3029 argv[i]);
3030 break;
3031 }
3032 if (LocaleCompare("support",option+1) == 0)
3033 {
3034 i++; /* deprecated */
3035 break;
3036 }
3037 if (LocaleCompare("swap",option+1) == 0)
3038 {
3039 if (*option == '+')
3040 break;
3041 i++;
3042 if (i == (ssize_t) argc)
3043 ThrowConvertException(OptionError,"MissingArgument",option);
3044 if (IsGeometry(argv[i]) == MagickFalse)
3045 ThrowConvertInvalidArgumentException(option,argv[i]);
3046 break;
3047 }
3048 if (LocaleCompare("swirl",option+1) == 0)
3049 {
3050 if (*option == '+')
3051 break;
3052 i++;
3053 if (i == (ssize_t) argc)
3054 ThrowConvertException(OptionError,"MissingArgument",option);
3055 if (IsGeometry(argv[i]) == MagickFalse)
3056 ThrowConvertInvalidArgumentException(option,argv[i]);
3057 break;
3058 }
3059 if (LocaleCompare("synchronize",option+1) == 0)
3060 break;
3061 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3062 }
3063 case 't':
3064 {
3065 if (LocaleCompare("taint",option+1) == 0)
3066 break;
3067 if (LocaleCompare("texture",option+1) == 0)
3068 {
3069 if (*option == '+')
3070 break;
3071 i++;
3072 if (i == (ssize_t) argc)
3073 ThrowConvertException(OptionError,"MissingArgument",option);
3074 break;
3075 }
3076 if (LocaleCompare("threshold",option+1) == 0)
3077 {
3078 if (*option == '+')
3079 break;
3080 i++;
3081 if (i == (ssize_t) argc)
3082 ThrowConvertException(OptionError,"MissingArgument",option);
3083 if (IsGeometry(argv[i]) == MagickFalse)
3084 ThrowConvertInvalidArgumentException(option,argv[i]);
3085 break;
3086 }
3087 if (LocaleCompare("thumbnail",option+1) == 0)
3088 {
3089 if (*option == '+')
3090 break;
3091 i++;
3092 if (i == (ssize_t) argc)
3093 ThrowConvertException(OptionError,"MissingArgument",option);
3094 if (IsGeometry(argv[i]) == MagickFalse)
3095 ThrowConvertInvalidArgumentException(option,argv[i]);
3096 break;
3097 }
3098 if (LocaleCompare("tile",option+1) == 0)
3099 {
3100 if (*option == '+')
3101 break;
3102 i++;
3103 if (i == (ssize_t) argc)
3104 ThrowConvertException(OptionError,"MissingArgument",option);
3105 break;
3106 }
3107 if (LocaleCompare("tile-offset",option+1) == 0)
3108 {
3109 if (*option == '+')
3110 break;
3111 i++;
3112 if (i == (ssize_t) argc)
3113 ThrowConvertException(OptionError,"MissingArgument",option);
3114 if (IsGeometry(argv[i]) == MagickFalse)
3115 ThrowConvertInvalidArgumentException(option,argv[i]);
3116 break;
3117 }
3118 if (LocaleCompare("tint",option+1) == 0)
3119 {
3120 if (*option == '+')
3121 break;
3122 i++;
3123 if (i == (ssize_t) argc)
3124 ThrowConvertException(OptionError,"MissingArgument",option);
3125 if (IsGeometry(argv[i]) == MagickFalse)
3126 ThrowConvertInvalidArgumentException(option,argv[i]);
3127 break;
3128 }
3129 if (LocaleCompare("transform",option+1) == 0)
3130 break;
3131 if (LocaleCompare("transparent",option+1) == 0)
3132 {
3133 i++;
3134 if (i == (ssize_t) argc)
3135 ThrowConvertException(OptionError,"MissingArgument",option);
3136 break;
3137 }
3138 if (LocaleCompare("transparent-color",option+1) == 0)
3139 {
3140 if (*option == '+')
3141 break;
3142 i++;
3143 if (i == (ssize_t) argc)
3144 ThrowConvertException(OptionError,"MissingArgument",option);
3145 break;
3146 }
3147 if (LocaleCompare("transpose",option+1) == 0)
3148 break;
3149 if (LocaleCompare("transverse",option+1) == 0)
3150 break;
3151 if (LocaleCompare("treedepth",option+1) == 0)
3152 {
3153 if (*option == '+')
3154 break;
3155 i++;
3156 if (i == (ssize_t) argc)
3157 ThrowConvertException(OptionError,"MissingArgument",option);
3158 if (IsGeometry(argv[i]) == MagickFalse)
3159 ThrowConvertInvalidArgumentException(option,argv[i]);
3160 break;
3161 }
3162 if (LocaleCompare("trim",option+1) == 0)
3163 break;
3164 if (LocaleCompare("type",option+1) == 0)
3165 {
3166 ssize_t
3167 type;
3168
3169 if (*option == '+')
3170 break;
3171 i++;
3172 if (i == (ssize_t) argc)
3173 ThrowConvertException(OptionError,"MissingArgument",option);
3174 type=ParseCommandOption(MagickTypeOptions,MagickFalse,argv[i]);
3175 if (type < 0)
3176 ThrowConvertException(OptionError,"UnrecognizedImageType",
3177 argv[i]);
3178 break;
3179 }
3180 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3181 }
3182 case 'u':
3183 {
3184 if (LocaleCompare("undercolor",option+1) == 0)
3185 {
3186 if (*option == '+')
3187 break;
3188 i++;
3189 if (i == (ssize_t) argc)
3190 ThrowConvertException(OptionError,"MissingArgument",option);
3191 break;
3192 }
3193 if (LocaleCompare("unique-colors",option+1) == 0)
3194 break;
3195 if (LocaleCompare("units",option+1) == 0)
3196 {
3197 ssize_t
3198 units;
3199
3200 if (*option == '+')
3201 break;
3202 i++;
3203 if (i == (ssize_t) argc)
3204 ThrowConvertException(OptionError,"MissingArgument",option);
3205 units=ParseCommandOption(MagickResolutionOptions,MagickFalse,
3206 argv[i]);
3207 if (units < 0)
3208 ThrowConvertException(OptionError,"UnrecognizedUnitsType",
3209 argv[i]);
3210 break;
3211 }
3212 if (LocaleCompare("unsharp",option+1) == 0)
3213 {
3214 if (*option == '+')
3215 break;
3216 i++;
3217 if (i == (ssize_t) argc)
3218 ThrowConvertException(OptionError,"MissingArgument",option);
3219 if (IsGeometry(argv[i]) == MagickFalse)
3220 ThrowConvertInvalidArgumentException(option,argv[i]);
3221 break;
3222 }
3223 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3224 }
3225 case 'v':
3226 {
3227 if (LocaleCompare("verbose",option+1) == 0)
3228 break;
3229 if ((LocaleCompare("version",option+1) == 0) ||
3230 (LocaleCompare("-version",option+1) == 0))
3231 {
3232 ListMagickVersion(stdout);
3233 break;
3234 }
3235 if (LocaleCompare("vignette",option+1) == 0)
3236 {
3237 if (*option == '+')
3238 break;
3239 i++;
3240 if (i == (ssize_t) argc)
3241 ThrowConvertException(OptionError,"MissingArgument",option);
3242 if (IsGeometry(argv[i]) == MagickFalse)
3243 ThrowConvertInvalidArgumentException(option,argv[i]);
3244 break;
3245 }
3246 if (LocaleCompare("virtual-pixel",option+1) == 0)
3247 {
3248 ssize_t
3249 method;
3250
3251 if (*option == '+')
3252 break;
3253 i++;
3254 if (i == (ssize_t) argc)
3255 ThrowConvertException(OptionError,"MissingArgument",option);
3256 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
3257 argv[i]);
3258 if (method < 0)
3259 ThrowConvertException(OptionError,
3260 "UnrecognizedVirtualPixelMethod",argv[i]);
3261 break;
3262 }
3263 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3264 }
3265 case 'w':
3266 {
3267 if (LocaleCompare("wave",option+1) == 0)
3268 {
3269 i++;
3270 if (i == (ssize_t) argc)
3271 ThrowConvertException(OptionError,"MissingArgument",option);
3272 if (IsGeometry(argv[i]) == MagickFalse)
3273 ThrowConvertInvalidArgumentException(option,argv[i]);
3274 break;
3275 }
3276 if (LocaleCompare("wavelet-denoise",option+1) == 0)
3277 {
3278 i++;
3279 if (i == (ssize_t) argc)
3280 ThrowConvertException(OptionError,"MissingArgument",option);
3281 if (IsGeometry(argv[i]) == MagickFalse)
3282 ThrowConvertInvalidArgumentException(option,argv[i]);
3283 break;
3284 }
3285 if (LocaleCompare("weight",option+1) == 0)
3286 {
3287 if (*option == '+')
3288 break;
3289 i++;
3290 if (i == (ssize_t) argc)
3291 ThrowConvertException(OptionError,"MissingArgument",option);
3292 break;
3293 }
3294 if (LocaleCompare("white-point",option+1) == 0)
3295 {
3296 if (*option == '+')
3297 break;
3298 i++;
3299 if (i == (ssize_t) argc)
3300 ThrowConvertException(OptionError,"MissingArgument",option);
3301 if (IsGeometry(argv[i]) == MagickFalse)
3302 ThrowConvertInvalidArgumentException(option,argv[i]);
3303 break;
3304 }
3305 if (LocaleCompare("white-balance",option+1) == 0)
3306 break;
3307 if (LocaleCompare("white-threshold",option+1) == 0)
3308 {
3309 if (*option == '+')
3310 break;
3311 i++;
3312 if (i == (ssize_t) argc)
3313 ThrowConvertException(OptionError,"MissingArgument",option);
3314 if (IsGeometry(argv[i]) == MagickFalse)
3315 ThrowConvertInvalidArgumentException(option,argv[i]);
3316 break;
3317 }
3318 if (LocaleCompare("word-break",option+1) == 0)
3319 {
3320 ssize_t
3321 word_break;
3322
3323 if (*option == '+')
3324 break;
3325 i++;
3326 if (i == (ssize_t) argc)
3327 ThrowConvertException(OptionError,"MissingArgument",option);
3328 word_break=ParseCommandOption(MagickWordBreakOptions,MagickFalse,
3329 argv[i]);
3330 if (word_break < 0)
3331 ThrowConvertException(OptionError,"UnrecognizedArgument",argv[i]);
3332 break;
3333 }
3334 if (LocaleCompare("write",option+1) == 0)
3335 {
3336 i++;
3337 if (i == (ssize_t) argc)
3338 ThrowConvertException(OptionError,"MissingArgument",option);
3339 break;
3340 }
3341 if (LocaleCompare("write-mask",option+1) == 0)
3342 {
3343 if (*option == '+')
3344 break;
3345 i++;
3346 if (i == (ssize_t) argc)
3347 ThrowConvertException(OptionError,"MissingArgument",option);
3348 break;
3349 }
3350 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3351 }
3352 case '?':
3353 break;
3354 default:
3355 ThrowConvertException(OptionError,"UnrecognizedOption",option)
3356 }
3357 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
3358 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
3359 if (fire != MagickFalse)
3360 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
3361 }
3362 if (k != 0)
3363 ThrowConvertException(OptionError,"UnbalancedParenthesis",argv[i]);
3364 if (i-- != (ssize_t) (argc-1))
3365 ThrowConvertException(OptionError,"MissingAnImageFilename",argv[argc-1]);
3366 FinalizeImageSettings(image_info,image,MagickTrue);
3367 if (image == (Image *) NULL)
3368 ThrowConvertException(OptionError,"NoImagesDefined",argv[argc-1]);
3369 if (IsCommandOption(argv[argc-1]))
3370 ThrowConvertException(OptionError,"MissingAnImageFilename",argv[argc-1]);
3371 if (LocaleCompare(" ",argv[argc-1]) == 0) /* common line continuation error */
3372 ThrowConvertException(OptionError,"MissingAnImageFilename",argv[argc-1]);
3373 status&=(MagickStatusType) WriteImages(image_info,image,argv[argc-1],
3374 exception);
3375 if (metadata != (char **) NULL)
3376 {
3377 char
3378 *text;
3379
3380 text=InterpretImageProperties(image_info,image,format,exception);
3381 if (text == (char *) NULL)
3382 ThrowConvertException(ResourceLimitError,"MemoryAllocationFailed",
3383 GetExceptionMessage(errno));
3384 (void) ConcatenateString(&(*metadata),text);
3385 text=DestroyString(text);
3386 }
3387 DestroyConvert();
3388 return(status != 0 ? MagickTrue : MagickFalse);
3389}
3390
3391/*
3392%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3393% %
3394% %
3395% %
3396% M a g i c k G e t I m a g e A l p h a C o l o r %
3397% %
3398% %
3399% %
3400%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3401%
3402% MagickGetImageAlphaColor() returns the image alpha color.
3403%
3404% The format of the MagickGetImageAlphaColor method is:
3405%
3406% MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
3407% PixelWand *alpha_color)
3408%
3409% A description of each parameter follows:
3410%
3411% o wand: the magick wand.
3412%
3413% o alpha_color: return the alpha color.
3414%
3415*/
3416WandExport MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
3417 PixelWand *alpha_color)
3418{
3419 assert(wand != (MagickWand *)NULL);
3420 assert(wand->signature == MagickWandSignature);
3421 if (wand->debug != MagickFalse)
3422 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3423 if (wand->images == (Image *)NULL)
3424 ThrowWandException(WandError, "ContainsNoImages", wand->name);
3425 PixelSetPixelColor(alpha_color,&wand->images->matte_color);
3426 return(MagickTrue);
3427}
3428
3429/*
3430%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3431% %
3432% %
3433% %
3434% M a g i c k S e t I m a g e A l p h a C o l o r %
3435% %
3436% %
3437% %
3438%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3439%
3440% MagickSetImageAlphaColor() sets the image alpha color.
3441%
3442% The format of the MagickSetImageAlphaColor method is:
3443%
3444% MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
3445% const PixelWand *matte)
3446%
3447% A description of each parameter follows:
3448%
3449% o wand: the magick wand.
3450%
3451% o matte: the alpha pixel wand.
3452%
3453*/
3454WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
3455 const PixelWand *alpha)
3456{
3457 assert(wand != (MagickWand *)NULL);
3458 assert(wand->signature == MagickWandSignature);
3459 if (wand->debug != MagickFalse)
3460 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3461 if (wand->images == (Image *)NULL)
3462 ThrowWandException(WandError,"ContainsNoImages",wand->name);
3463 PixelGetQuantumPacket(alpha,&wand->images->matte_color);
3464 return(MagickTrue);
3465}
3466#endif