45#include "MagickWand/studio.h"
46#include "MagickWand/MagickWand.h"
47#include "MagickWand/mogrify-private.h"
48#include "MagickCore/exception-private.h"
49#include "MagickCore/string-private.h"
50#include "MagickCore/utility-private.h"
86static MagickBooleanType ConcatenateImages(
int argc,
char **argv,
87 ExceptionInfo *exception)
105 output=fopen_utf8(argv[argc-1],
"wb");
106 if (output == (FILE *) NULL)
108 ThrowFileException(exception,FileOpenError,
"UnableToOpenFile",
113 for (i=2; i < (ssize_t) (argc-1); i++)
115 input=fopen_utf8(argv[i],
"rb");
116 if (input == (FILE *) NULL)
118 ThrowFileException(exception,FileOpenError,
"UnableToOpenFile",argv[i]);
121 for (c=fgetc(input); c != EOF; c=fgetc(input))
122 if (fputc((
char) c,output) != c)
124 (void) fclose(input);
125 (void) remove_utf8(argv[i]);
127 (void) fclose(output);
131static MagickBooleanType ConvertUsage(
void)
134 channel_operators[] =
135 " -channel-fx expression\n"
136 " exchange, extract, or transfer one or more image channels\n"
137 " -separate separate an image channel into a grayscale image",
139 " -debug events display copious debugging information\n"
140 " -distribute-cache port\n"
141 " distributed pixel cache spanning one or more servers\n"
142 " -help print program options\n"
143 " -list type print a list of supported option arguments\n"
144 " -log format format of debugging information\n"
145 " -version print version information",
147 " -adaptive-blur geometry\n"
148 " adaptively blur pixels; decrease effect near edges\n"
149 " -adaptive-resize geometry\n"
150 " adaptively resize image using 'mesh' interpolation\n"
151 " -adaptive-sharpen geometry\n"
152 " adaptively sharpen pixels; increase effect near edges\n"
153 " -alpha option on, activate, off, deactivate, set, opaque, copy\n"
154 " transparent, extract, background, or shape\n"
155 " -annotate geometry text\n"
156 " annotate the image with text\n"
157 " -auto-gamma automagically adjust gamma level of image\n"
158 " -auto-level automagically adjust color levels of image\n"
159 " -auto-orient automagically orient (rotate) image\n"
160 " -auto-threshold method\n"
161 " automatically perform image thresholding\n"
162 " -bench iterations measure performance\n"
163 " -bilateral-blur geometry\n"
164 " non-linear, edge-preserving, and noise-reducing smoothing filter\n"
165 " -black-threshold value\n"
166 " force all pixels below the threshold into black\n"
167 " -blue-shift factor simulate a scene at nighttime in the moonlight\n"
168 " -blur geometry reduce image noise and reduce detail levels\n"
169 " -border geometry surround image with a border of color\n"
170 " -bordercolor color border color\n"
171 " -brightness-contrast geometry\n"
172 " improve brightness / contrast of the image\n"
173 " -canny geometry detect edges in the image\n"
174 " -cdl filename color correct with a color decision list\n"
175 " -channel mask set the image channel mask\n"
176 " -charcoal radius simulate a charcoal drawing\n"
177 " -chop geometry remove pixels from the image interior\n"
178 " -clahe geometry contrast limited adaptive histogram equalization\n"
179 " -clamp keep pixel values in range (0-QuantumRange)\n"
180 " -colorize value colorize the image with the fill color\n"
181 " -color-matrix matrix apply color correction to the image\n"
182 " -colors value preferred number of colors in the image\n"
183 " -connected-components connectivity\n"
184 " connected-components uniquely labeled\n"
185 " -contrast enhance or reduce the image contrast\n"
186 " -contrast-stretch geometry\n"
187 " improve contrast by 'stretching' the intensity range\n"
188 " -convolve coefficients\n"
189 " apply a convolution kernel to the image\n"
190 " -cycle amount cycle the image colormap\n"
191 " -decipher filename convert cipher pixels to plain pixels\n"
192 " -deskew threshold straighten an image\n"
193 " -despeckle reduce the speckles within an image\n"
194 " -distort method args\n"
195 " distort images according to given method and args\n"
196 " -draw string annotate the image with a graphic primitive\n"
197 " -edge radius apply a filter to detect edges in the image\n"
198 " -encipher filename convert plain pixels to cipher pixels\n"
199 " -emboss radius emboss an image\n"
200 " -enhance apply a digital filter to enhance a noisy image\n"
201 " -equalize perform histogram equalization to an image\n"
202 " -evaluate operator value\n"
203 " evaluate an arithmetic, relational, or logical expression\n"
204 " -extent geometry set the image size\n"
205 " -extract geometry extract area from image\n"
206 " -fft implements the discrete Fourier transform (DFT)\n"
207 " -flip flip image vertically\n"
208 " -floodfill geometry color\n"
209 " floodfill the image with color\n"
210 " -flop flop image horizontally\n"
211 " -frame geometry surround image with an ornamental border\n"
212 " -function name parameters\n"
213 " apply function over image values\n"
214 " -gamma value level of gamma correction\n"
215 " -gaussian-blur geometry\n"
216 " reduce image noise and reduce detail levels\n"
217 " -geometry geometry preferred size or location of the image\n"
218 " -grayscale method convert image to grayscale\n"
219 " -hough-lines geometry\n"
220 " identify lines in the image\n"
221 " -identify identify the format and characteristics of the image\n"
222 " -ift implements the inverse discrete Fourier transform (DFT)\n"
223 " -implode amount implode image pixels about the center\n"
224 " -integral calculate the sum of values (pixel values) in the image\n"
225 " -interpolative-resize geometry\n"
226 " resize image using interpolation\n"
227 " -kmeans geometry K means color reduction\n"
228 " -kuwahara geometry edge preserving noise reduction filter\n"
229 " -lat geometry local adaptive thresholding\n"
230 " -level value adjust the level of image contrast\n"
231 " -level-colors color,color\n"
232 " level image with the given colors\n"
233 " -linear-stretch geometry\n"
234 " improve contrast by 'stretching with saturation'\n"
235 " -liquid-rescale geometry\n"
236 " rescale image with seam-carving\n"
237 " -local-contrast geometry\n"
238 " enhance local contrast\n"
239 " -mean-shift geometry delineate arbitrarily shaped clusters in the image\n"
240 " -median geometry apply a median filter to the image\n"
241 " -mode geometry make each pixel the 'predominant color' of the\n"
243 " -modulate value vary the brightness, saturation, and hue\n"
244 " -monochrome transform image to black and white\n"
245 " -morphology method kernel\n"
246 " apply a morphology method to the image\n"
247 " -motion-blur geometry\n"
248 " simulate motion blur\n"
249 " -negate replace every pixel with its complementary color \n"
250 " -noise geometry add or reduce noise in an image\n"
251 " -normalize transform image to span the full range of colors\n"
252 " -opaque color change this color to the fill color\n"
253 " -ordered-dither NxN\n"
254 " add a noise pattern to the image with specific\n"
256 " -paint radius simulate an oil painting\n"
257 " -perceptible epsilon\n"
258 " pixel value less than |epsilon| become epsilon or\n"
260 " -polaroid angle simulate a Polaroid picture\n"
261 " -posterize levels reduce the image to a limited number of color levels\n"
262 " -profile filename add, delete, or apply an image profile\n"
263 " -quantize colorspace reduce colors in this colorspace\n"
264 " -raise value lighten/darken image edges to create a 3-D effect\n"
265 " -random-threshold low,high\n"
266 " random threshold the image\n"
267 " -range-threshold values\n"
268 " perform either hard or soft thresholding within some range of values in an image\n"
269 " -region geometry apply options to a portion of the image\n"
270 " -render render vector graphics\n"
271 " -resample geometry change the resolution of an image\n"
272 " -reshape geometry reshape the image\n"
273 " -resize geometry resize the image\n"
274 " -roll geometry roll an image vertically or horizontally\n"
275 " -rotate degrees apply Paeth rotation to the image\n"
276 " -rotational-blur angle\n"
277 " rotational blur the image\n"
278 " -sample geometry scale image with pixel sampling\n"
279 " -scale geometry scale the image\n"
280 " -segment values segment an image\n"
281 " -selective-blur geometry\n"
282 " selectively blur pixels within a contrast threshold\n"
283 " -sepia-tone threshold\n"
284 " simulate a sepia-toned photo\n"
285 " -set property value set an image property\n"
286 " -shade degrees shade the image using a distant light source\n"
287 " -shadow geometry simulate an image shadow\n"
288 " -sharpen geometry sharpen the image\n"
289 " -shave geometry shave pixels from the image edges\n"
290 " -shear geometry slide one edge of the image along the X or Y axis\n"
291 " -sigmoidal-contrast geometry\n"
292 " increase the contrast without saturating highlights or\n"
294 " -sketch geometry simulate a pencil sketch\n"
295 " -solarize threshold negate all pixels above the threshold level\n"
296 " -sort-pixels sort each scanline in ascending order of intensity\n"
297 " -sparse-color method args\n"
298 " fill in a image based on a few color points\n"
299 " -splice geometry splice the background color into the image\n"
300 " -spread radius displace image pixels by a random amount\n"
301 " -statistic type geometry\n"
302 " replace each pixel with corresponding statistic from the\n"
304 " -strip strip image of all profiles and comments\n"
305 " -swirl degrees swirl image pixels about the center\n"
306 " -threshold value threshold the image\n"
307 " -thumbnail geometry create a thumbnail of the image\n"
308 " -tile filename tile image when filling a graphic primitive\n"
309 " -tint value tint the image with the fill color\n"
310 " -transform affine transform image\n"
311 " -transparent color make this color transparent within the image\n"
312 " -transpose flip image vertically and rotate 90 degrees\n"
313 " -transverse flop image horizontally and rotate 270 degrees\n"
314 " -trim trim image edges\n"
315 " -type type image type\n"
316 " -unique-colors discard all but one of any pixel color\n"
317 " -unsharp geometry sharpen the image\n"
318 " -vignette geometry soften the edges of the image in vignette style\n"
319 " -wave geometry alter an image along a sine wave\n"
320 " -wavelet-denoise threshold\n"
321 " removes noise from the image using a wavelet transform\n"
322 " -white-balance automagically adjust white balance of image\n"
323 " -white-threshold value\n"
324 " force all pixels above the threshold into white",
325 sequence_operators[] =
326 " -append append an image sequence\n"
327 " -clut apply a color lookup table to the image\n"
328 " -coalesce merge a sequence of images\n"
329 " -combine combine a sequence of images\n"
330 " -compare mathematically and visually annotate the difference between an image and its reconstruction\n"
331 " -complex operator perform complex mathematics on an image sequence\n"
332 " -composite composite image\n"
333 " -copy geometry offset\n"
334 " copy pixels from one area of an image to another\n"
335 " -crop geometry cut out a rectangular region of the image\n"
336 " -deconstruct break down an image sequence into constituent parts\n"
337 " -evaluate-sequence operator\n"
338 " evaluate an arithmetic, relational, or logical expression\n"
339 " -flatten flatten a sequence of images\n"
340 " -fx expression apply mathematical expression to an image channel(s)\n"
341 " -hald-clut apply a Hald color lookup table to the image\n"
342 " -layers method optimize, merge, or compare image layers\n"
343 " -morph value morph an image sequence\n"
344 " -mosaic create a mosaic from an image sequence\n"
345 " -poly terms build a polynomial from the image sequence and the corresponding\n"
346 " terms (coefficients and degree pairs).\n"
347 " -print string interpret string and print to console\n"
348 " -process arguments process the image with a custom image filter\n"
349 " -smush geometry smush an image sequence together\n"
350 " -write filename write images to this file",
352 " -adjoin join images into a single multi-image file\n"
353 " -affine matrix affine transform matrix\n"
354 " -alpha option activate, deactivate, reset, or set the alpha channel\n"
355 " -antialias remove pixel-aliasing\n"
356 " -authenticate password\n"
357 " decipher image with this password\n"
358 " -attenuate value lessen (or intensify) when adding noise to an image\n"
359 " -background color background color\n"
360 " -bias value add bias when convolving an image\n"
361 " -black-point-compensation\n"
362 " use black point compensation\n"
363 " -blue-primary point chromaticity blue primary point\n"
364 " -bordercolor color border color\n"
365 " -caption string assign a caption to an image\n"
366 " -clip clip along the first path from the 8BIM profile\n"
367 " -clip-mask filename associate a clip mask with the image\n"
368 " -clip-path id clip along a named path from the 8BIM profile\n"
369 " -colorspace type alternate image colorspace\n"
370 " -comment string annotate image with comment\n"
371 " -compose operator set image composite operator\n"
372 " -compress type type of pixel compression when writing the image\n"
373 " -define format:option\n"
374 " define one or more image format options\n"
375 " -delay value display the next image after pausing\n"
376 " -density geometry horizontal and vertical density of the image\n"
377 " -depth value image depth\n"
378 " -direction type render text right-to-left or left-to-right\n"
379 " -display server get image or font from this X server\n"
380 " -dispose method layer disposal method\n"
381 " -dither method apply error diffusion to image\n"
382 " -encoding type text encoding type\n"
383 " -endian type endianness (MSB or LSB) of the image\n"
384 " -family name render text with this font family\n"
385 " -features distance analyze image features (e.g. contrast, correlation)\n"
386 " -fill color color to use when filling a graphic primitive\n"
387 " -filter type use this filter when resizing an image\n"
388 " -font name render text with this font\n"
389 " -format \"string\" output formatted image characteristics\n"
390 " -fuzz distance colors within this distance are considered equal\n"
391 " -gravity type horizontal and vertical text placement\n"
392 " -green-primary point chromaticity green primary point\n"
393 " -illuminant type reference illuminant\n"
394 " -intensity method method to generate an intensity value from a pixel\n"
395 " -intent type type of rendering intent when managing the image color\n"
396 " -interlace type type of image interlacing scheme\n"
397 " -interline-spacing value\n"
398 " set the space between two text lines\n"
399 " -interpolate method pixel color interpolation method\n"
400 " -interword-spacing value\n"
401 " set the space between two words\n"
402 " -kerning value set the space between two letters\n"
403 " -label string assign a label to an image\n"
404 " -limit type value pixel cache resource limit\n"
405 " -loop iterations add Netscape loop extension to your GIF animation\n"
406 " -matte store matte channel if the image has one\n"
407 " -mattecolor color frame color\n"
408 " -moments report image moments\n"
409 " -monitor monitor progress\n"
410 " -orient type image orientation\n"
411 " -page geometry size and location of an image canvas (setting)\n"
412 " -ping efficiently determine image attributes\n"
413 " -pointsize value font point size\n"
414 " -precision value maximum number of significant digits to print\n"
415 " -preview type image preview type\n"
416 " -quality value JPEG/MIFF/PNG compression level\n"
417 " -quiet suppress all warning messages\n"
418 " -read-mask filename associate a read mask with the image\n"
419 " -red-primary point chromaticity red primary point\n"
420 " -regard-warnings pay attention to warning messages\n"
421 " -remap filename transform image colors to match this set of colors\n"
422 " -repage geometry size and location of an image canvas\n"
423 " -respect-parentheses settings remain in effect until parenthesis boundary\n"
424 " -sampling-factor geometry\n"
425 " horizontal and vertical sampling factor\n"
426 " -scene value image scene number\n"
427 " -seed value seed a new sequence of pseudo-random numbers\n"
428 " -size geometry width and height of image\n"
429 " -stretch type render text with this font stretch\n"
430 " -stroke color graphic primitive stroke color\n"
431 " -strokewidth value graphic primitive stroke width\n"
432 " -style type render text with this font style\n"
433 " -support factor resize support: > 1.0 is blurry, < 1.0 is sharp\n"
434 " -synchronize synchronize image to storage device\n"
435 " -taint declare the image as modified\n"
436 " -texture filename name of texture to tile onto the image background\n"
437 " -tile-offset geometry\n"
439 " -treedepth value color tree depth\n"
440 " -transparent-color color\n"
441 " transparent color\n"
442 " -undercolor color annotation bounding box color\n"
443 " -units type the units of image resolution\n"
444 " -verbose print detailed information about the image\n"
445 " -view FlashPix viewing transforms\n"
446 " -virtual-pixel method\n"
447 " virtual pixel access method\n"
448 " -weight type render text with this font weight\n"
449 " -white-point point chromaticity white point\n"
450 " -write-mask filename associate a write mask with the image"
451 " -word-break type sets whether line breaks appear wherever the text would otherwise overflow",
453 " -clone indexes clone an image\n"
454 " -delete indexes delete the image from the image sequence\n"
455 " -duplicate count,indexes\n"
456 " duplicate an image one or more times\n"
457 " -insert index insert last image into the image sequence\n"
458 " -reverse reverse image sequence\n"
459 " -swap indexes swap two images in the image sequence";
461 ListMagickVersion(stdout);
462 (void) printf(
"Usage: %s [options ...] file [ [options ...] "
463 "file ...] [options ...] file\n",GetClientName());
464 (void) printf(
"\nImage Settings:\n");
465 (void) puts(settings);
466 (void) printf(
"\nImage Operators:\n");
467 (void) puts(operators);
468 (void) printf(
"\nImage Channel Operators:\n");
469 (void) puts(channel_operators);
470 (void) printf(
"\nImage Sequence Operators:\n");
471 (void) puts(sequence_operators);
472 (void) printf(
"\nImage Stack Operators:\n");
473 (void) puts(stack_operators);
474 (void) printf(
"\nMiscellaneous Options:\n");
475 (void) puts(miscellaneous);
477 "\nBy default, the image format of 'file' is determined by its magic\n");
479 "number. To specify a particular image format, precede the filename\n");
481 "with an image format name and a colon (i.e. ps:image) or specify the\n");
483 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
484 (void) printf(
"'-' for standard input or output.\n");
488WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
489 int argc,
char **argv,
char **metadata,ExceptionInfo *exception)
491#define NotInitialized (unsigned int) (~0)
492#define DestroyConvert() \
494 DestroyImageStack(); \
495 for (i=0; i < (ssize_t) argc; i++) \
496 argv[i]=DestroyString(argv[i]); \
497 argv=(char **) RelinquishMagickMemory(argv); \
499#define ThrowConvertException(asperity,tag,option) \
501 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
504 return(MagickFalse); \
506#define ThrowConvertInvalidArgumentException(option,argument) \
508 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
509 "InvalidArgument","'%s': %s",option,argument); \
511 return(MagickFalse); \
522 *image = (Image *) NULL;
525 image_stack[MaxImageStackDepth+1];
545 assert(image_info != (ImageInfo *) NULL);
546 assert(image_info->signature == MagickCoreSignature);
547 assert(exception != (ExceptionInfo *) NULL);
548 if (IsEventLogging() != MagickFalse)
549 (void) LogMagickEvent(TraceEvent,GetMagickModule(),
"...");
553 if ((LocaleCompare(
"help",option+1) == 0) ||
554 (LocaleCompare(
"-help",option+1) == 0))
555 return(ConvertUsage());
556 if ((LocaleCompare(
"version",option+1) == 0) ||
557 (LocaleCompare(
"-version",option+1) == 0))
559 ListMagickVersion(stdout);
565 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
566 "MissingArgument",
"%s",
"");
567 (void) ConvertUsage();
570 filename=(
char *) NULL;
575 option=(
char *) NULL;
577 respect_parenthesis=MagickFalse;
582 ReadCommandlLine(argc,&argv);
583 status=ExpandFilenames(&argc,&argv);
584 if (status == MagickFalse)
585 ThrowConvertException(ResourceLimitError,
"MemoryAllocationFailed",
586 GetExceptionMessage(errno));
587 if ((argc > 2) && (LocaleCompare(
"-concatenate",argv[1]) == 0))
588 return(ConcatenateImages(argc,argv,exception));
589 for (i=1; i < (ssize_t) (argc-1); i++)
592 if (LocaleCompare(option,
"(") == 0)
594 FireImageStack(MagickTrue,MagickTrue,pend);
595 if (k == MaxImageStackDepth)
596 ThrowConvertException(OptionError,
"ParenthesisNestedTooDeeply",
601 if (LocaleCompare(option,
")") == 0)
603 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
605 ThrowConvertException(OptionError,
"UnableToParseExpression",option);
609 if (IsCommandOption(option) == MagickFalse)
617 FireImageStack(MagickTrue,MagickTrue,pend);
619 if ((LocaleCompare(filename,
"--") == 0) && (i < (ssize_t) (argc-1)))
621 if (image_info->ping != MagickFalse)
622 images=PingImages(image_info,filename,exception);
624 images=ReadImages(image_info,filename,exception);
625 status&=(MagickStatusType) (images != (Image *) NULL) &&
626 (exception->severity < ErrorException);
627 if (images == (Image *) NULL)
629 AppendImageStack(images);
632 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
637 if (LocaleCompare(
"adaptive-blur",option+1) == 0)
640 if (i == (ssize_t) argc)
641 ThrowConvertException(OptionError,
"MissingArgument",option);
642 if (IsGeometry(argv[i]) == MagickFalse)
643 ThrowConvertInvalidArgumentException(option,argv[i]);
646 if (LocaleCompare(
"adaptive-resize",option+1) == 0)
649 if (i == (ssize_t) argc)
650 ThrowConvertException(OptionError,
"MissingArgument",option);
651 if (IsGeometry(argv[i]) == MagickFalse)
652 ThrowConvertInvalidArgumentException(option,argv[i]);
655 if (LocaleCompare(
"adaptive-sharpen",option+1) == 0)
658 if (i == (ssize_t) argc)
659 ThrowConvertException(OptionError,
"MissingArgument",option);
660 if (IsGeometry(argv[i]) == MagickFalse)
661 ThrowConvertInvalidArgumentException(option,argv[i]);
664 if (LocaleCompare(
"adjoin",option+1) == 0)
666 if (LocaleCompare(
"affine",option+1) == 0)
671 if (i == (ssize_t) argc)
672 ThrowConvertException(OptionError,
"MissingArgument",option);
673 if (IsGeometry(argv[i]) == MagickFalse)
674 ThrowConvertInvalidArgumentException(option,argv[i]);
677 if (LocaleCompare(
"alpha",option+1) == 0)
685 if (i == (ssize_t) argc)
686 ThrowConvertException(OptionError,
"MissingArgument",option);
687 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
690 ThrowConvertException(OptionError,
691 "UnrecognizedAlphaChannelOption",argv[i]);
694 if (LocaleCompare(
"annotate",option+1) == 0)
699 if (i == (ssize_t) argc)
700 ThrowConvertException(OptionError,
"MissingArgument",option);
701 if (IsGeometry(argv[i]) == MagickFalse)
702 ThrowConvertInvalidArgumentException(option,argv[i]);
704 if (i == (ssize_t) argc)
705 ThrowConvertException(OptionError,
"MissingArgument",option);
708 if (LocaleCompare(
"antialias",option+1) == 0)
710 if (LocaleCompare(
"append",option+1) == 0)
712 if (LocaleCompare(
"attenuate",option+1) == 0)
717 if (i == (ssize_t) argc)
718 ThrowConvertException(OptionError,
"MissingArgument",option);
719 if (IsGeometry(argv[i]) == MagickFalse)
720 ThrowConvertInvalidArgumentException(option,argv[i]);
723 if (LocaleCompare(
"authenticate",option+1) == 0)
728 if (i == (ssize_t) argc)
729 ThrowConvertException(OptionError,
"MissingArgument",option);
732 if (LocaleCompare(
"auto-gamma",option+1) == 0)
734 if (LocaleCompare(
"auto-level",option+1) == 0)
736 if (LocaleCompare(
"auto-orient",option+1) == 0)
738 if (LocaleCompare(
"auto-threshold",option+1) == 0)
746 if (i == (ssize_t) argc)
747 ThrowConvertException(OptionError,
"MissingArgument",option);
748 method=ParseCommandOption(MagickAutoThresholdOptions,MagickFalse,
751 ThrowConvertException(OptionError,
"UnrecognizedThresholdMethod",
755 if (LocaleCompare(
"average",option+1) == 0)
757 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
761 if (LocaleCompare(
"background",option+1) == 0)
766 if (i == (ssize_t) argc)
767 ThrowConvertException(OptionError,
"MissingArgument",option);
770 if (LocaleCompare(
"bench",option+1) == 0)
775 if (i == (ssize_t) argc)
776 ThrowConvertException(OptionError,
"MissingArgument",option);
777 if (IsGeometry(argv[i]) == MagickFalse)
778 ThrowConvertInvalidArgumentException(option,argv[i]);
781 if (LocaleCompare(
"bias",option+1) == 0)
786 if (i == (ssize_t) argc)
787 ThrowConvertException(OptionError,
"MissingArgument",option);
788 if (IsGeometry(argv[i]) == MagickFalse)
789 ThrowConvertInvalidArgumentException(option,argv[i]);
792 if (LocaleCompare(
"bilateral-blur",option+1) == 0)
797 if (i == (ssize_t) argc)
798 ThrowConvertException(OptionError,
"MissingArgument",option);
799 if (IsGeometry(argv[i]) == MagickFalse)
800 ThrowConvertInvalidArgumentException(option,argv[i]);
803 if (LocaleCompare(
"black-point-compensation",option+1) == 0)
805 if (LocaleCompare(
"black-threshold",option+1) == 0)
810 if (i == (ssize_t) argc)
811 ThrowConvertException(OptionError,
"MissingArgument",option);
812 if (IsGeometry(argv[i]) == MagickFalse)
813 ThrowConvertInvalidArgumentException(option,argv[i]);
816 if (LocaleCompare(
"blue-primary",option+1) == 0)
821 if (i == (ssize_t) argc)
822 ThrowConvertException(OptionError,
"MissingArgument",option);
823 if (IsGeometry(argv[i]) == MagickFalse)
824 ThrowConvertInvalidArgumentException(option,argv[i]);
827 if (LocaleCompare(
"blue-shift",option+1) == 0)
832 if (i == (ssize_t) argc)
833 ThrowConvertException(OptionError,
"MissingArgument",option);
834 if (IsGeometry(argv[i]) == MagickFalse)
835 ThrowConvertInvalidArgumentException(option,argv[i]);
838 if (LocaleCompare(
"blur",option+1) == 0)
843 if (i == (ssize_t) argc)
844 ThrowConvertException(OptionError,
"MissingArgument",option);
845 if (IsGeometry(argv[i]) == MagickFalse)
846 ThrowConvertInvalidArgumentException(option,argv[i]);
849 if (LocaleCompare(
"border",option+1) == 0)
854 if (i == (ssize_t) argc)
855 ThrowConvertException(OptionError,
"MissingArgument",option);
856 if (IsGeometry(argv[i]) == MagickFalse)
857 ThrowConvertInvalidArgumentException(option,argv[i]);
860 if (LocaleCompare(
"bordercolor",option+1) == 0)
865 if (i == (ssize_t) argc)
866 ThrowConvertException(OptionError,
"MissingArgument",option);
869 if (LocaleCompare(
"box",option+1) == 0)
874 if (i == (ssize_t) argc)
875 ThrowConvertException(OptionError,
"MissingArgument",option);
878 if (LocaleCompare(
"brightness-contrast",option+1) == 0)
881 if (i == (ssize_t) argc)
882 ThrowConvertException(OptionError,
"MissingArgument",option);
883 if (IsGeometry(argv[i]) == MagickFalse)
884 ThrowConvertInvalidArgumentException(option,argv[i]);
887 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
891 if (LocaleCompare(
"cache",option+1) == 0)
896 if (i == (ssize_t) argc)
897 ThrowConvertException(OptionError,
"MissingArgument",option);
898 if (IsGeometry(argv[i]) == MagickFalse)
899 ThrowConvertInvalidArgumentException(option,argv[i]);
902 if (LocaleCompare(
"canny",option+1) == 0)
907 if (i == (ssize_t) argc)
908 ThrowConvertException(OptionError,
"MissingArgument",option);
909 if (IsGeometry(argv[i]) == MagickFalse)
910 ThrowConvertInvalidArgumentException(option,argv[i]);
913 if (LocaleCompare(
"caption",option+1) == 0)
918 if (i == (ssize_t) argc)
919 ThrowConvertException(OptionError,
"MissingArgument",option);
922 if (LocaleCompare(
"cdl",option+1) == 0)
927 if (i == (ssize_t) argc)
928 ThrowConvertException(OptionError,
"MissingArgument",option);
931 if (LocaleCompare(
"channel",option+1) == 0)
939 if (i == (ssize_t) argc)
940 ThrowConvertException(OptionError,
"MissingArgument",option);
941 channel=ParseChannelOption(argv[i]);
943 ThrowConvertException(OptionError,
"UnrecognizedChannelType",
947 if (LocaleCompare(
"channel-fx",option+1) == 0)
955 if (i == (ssize_t) argc)
956 ThrowConvertException(OptionError,
"MissingArgument",option);
957 channel=ParsePixelChannelOption(argv[i]);
959 ThrowConvertException(OptionError,
"UnrecognizedChannelType",
963 if (LocaleCompare(
"charcoal",option+1) == 0)
968 if (i == (ssize_t) argc)
969 ThrowConvertException(OptionError,
"MissingArgument",option);
970 if (IsGeometry(argv[i]) == MagickFalse)
971 ThrowConvertInvalidArgumentException(option,argv[i]);
974 if (LocaleCompare(
"chop",option+1) == 0)
979 if (i == (ssize_t) argc)
980 ThrowConvertException(OptionError,
"MissingArgument",option);
981 if (IsGeometry(argv[i]) == MagickFalse)
982 ThrowConvertInvalidArgumentException(option,argv[i]);
985 if (LocaleCompare(
"clahe",option+1) == 0)
990 if (i == (ssize_t) argc)
991 ThrowConvertException(OptionError,
"MissingArgument",option);
992 if (IsGeometry(argv[i]) == MagickFalse)
993 ThrowConvertInvalidArgumentException(option,argv[i]);
996 if (LocaleCompare(
"clamp",option+1) == 0)
998 if (LocaleCompare(
"clip",option+1) == 0)
1000 if (LocaleCompare(
"clip-mask",option+1) == 0)
1005 if (i == (ssize_t) argc)
1006 ThrowConvertException(OptionError,
"MissingArgument",option);
1009 if (LocaleCompare(
"clip-path",option+1) == 0)
1012 if (i == (ssize_t) argc)
1013 ThrowConvertException(OptionError,
"MissingArgument",option);
1016 if (LocaleCompare(
"clone",option+1) == 0)
1022 clone_list=CloneImageList(image,exception);
1024 clone_list=CloneImageList(image_stack[k-1].image,exception);
1025 if (clone_list == (Image *) NULL)
1026 ThrowConvertException(ImageError,
"ImageSequenceRequired",option);
1027 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
1029 clone_images=CloneImages(clone_list,
"-1",exception);
1033 if (i == (ssize_t) argc)
1034 ThrowConvertException(OptionError,
"MissingArgument",option);
1035 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1036 ThrowConvertInvalidArgumentException(option,argv[i]);
1037 clone_images=CloneImages(clone_list,argv[i],exception);
1039 if (clone_images == (Image *) NULL)
1040 ThrowConvertException(OptionError,
"NoSuchImage",option);
1041 AppendImageStack(clone_images);
1042 clone_list=DestroyImageList(clone_list);
1045 if (LocaleCompare(
"clut",option+1) == 0)
1047 if (LocaleCompare(
"coalesce",option+1) == 0)
1049 if (LocaleCompare(
"colorize",option+1) == 0)
1054 if (i == (ssize_t) argc)
1055 ThrowConvertException(OptionError,
"MissingArgument",option);
1056 if (IsGeometry(argv[i]) == MagickFalse)
1057 ThrowConvertInvalidArgumentException(option,argv[i]);
1060 if (LocaleCompare(
"color-matrix",option+1) == 0)
1068 if (i == (ssize_t) argc)
1069 ThrowConvertException(OptionError,
"MissingArgument",option);
1070 kernel_info=AcquireKernelInfo(argv[i],exception);
1071 if (kernel_info == (KernelInfo *) NULL)
1072 ThrowConvertInvalidArgumentException(option,argv[i]);
1073 kernel_info=DestroyKernelInfo(kernel_info);
1076 if (LocaleCompare(
"colors",option+1) == 0)
1081 if ((i == (ssize_t) argc) ||
1082 (IsGeometry(argv[i]) == MagickFalse))
1083 ThrowConvertException(OptionError,
"MissingArgument",option);
1086 if (LocaleCompare(
"colorspace",option+1) == 0)
1094 if (i == (ssize_t) argc)
1095 ThrowConvertException(OptionError,
"MissingArgument",option);
1096 colorspace=ParseCommandOption(MagickColorspaceOptions,
1097 MagickFalse,argv[i]);
1099 ThrowConvertException(OptionError,
"UnrecognizedColorspace",
1103 if (LocaleCompare(
"color-threshold",option+1) == 0)
1108 if (i == (ssize_t) argc)
1109 ThrowConvertException(OptionError,
"MissingArgument",option);
1112 if (LocaleCompare(
"combine",option+1) == 0)
1114 if (LocaleCompare(
"comment",option+1) == 0)
1119 if (i == (ssize_t) argc)
1120 ThrowConvertException(OptionError,
"MissingArgument",option);
1123 if (LocaleCompare(
"compare",option+1) == 0)
1125 if (LocaleCompare(
"complex",option+1) == 0)
1133 if (i == (ssize_t) argc)
1134 ThrowConvertException(OptionError,
"MissingArgument",option);
1135 op=ParseCommandOption(MagickComplexOptions,MagickFalse,argv[i]);
1137 ThrowConvertException(OptionError,
"UnrecognizedComplexOperator",
1141 if (LocaleCompare(
"compose",option+1) == 0)
1149 if (i == (ssize_t) argc)
1150 ThrowConvertException(OptionError,
"MissingArgument",option);
1151 compose=ParseCommandOption(MagickComposeOptions,MagickFalse,
1154 ThrowConvertException(OptionError,
"UnrecognizedComposeOperator",
1158 if (LocaleCompare(
"composite",option+1) == 0)
1160 if (LocaleCompare(
"compress",option+1) == 0)
1168 if (i == (ssize_t) argc)
1169 ThrowConvertException(OptionError,
"MissingArgument",option);
1170 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
1173 ThrowConvertException(OptionError,
"UnrecognizedImageCompression",
1177 if (LocaleCompare(
"concurrent",option+1) == 0)
1179 if (LocaleCompare(
"connected-components",option+1) == 0)
1182 if (i == (ssize_t) argc)
1183 ThrowConvertException(OptionError,
"MissingArgument",option);
1184 if (IsGeometry(argv[i]) == MagickFalse)
1185 ThrowConvertInvalidArgumentException(option,argv[i]);
1188 if (LocaleCompare(
"contrast",option+1) == 0)
1190 if (LocaleCompare(
"contrast-stretch",option+1) == 0)
1193 if (i == (ssize_t) argc)
1194 ThrowConvertException(OptionError,
"MissingArgument",option);
1195 if (IsGeometry(argv[i]) == MagickFalse)
1196 ThrowConvertInvalidArgumentException(option,argv[i]);
1199 if (LocaleCompare(
"convolve",option+1) == 0)
1207 if (i == (ssize_t) argc)
1208 ThrowConvertException(OptionError,
"MissingArgument",option);
1209 kernel_info=AcquireKernelInfo(argv[i],exception);
1210 if (kernel_info == (KernelInfo *) NULL)
1211 ThrowConvertInvalidArgumentException(option,argv[i]);
1212 kernel_info=DestroyKernelInfo(kernel_info);
1215 if (LocaleCompare(
"copy",option+1) == 0)
1220 if (i == (ssize_t) argc)
1221 ThrowConvertException(OptionError,
"MissingArgument",option);
1222 if (IsGeometry(argv[i]) == MagickFalse)
1223 ThrowConvertInvalidArgumentException(option,argv[i]);
1225 if (i == (ssize_t) argc)
1226 ThrowConvertException(OptionError,
"MissingArgument",option);
1227 if (IsGeometry(argv[i]) == MagickFalse)
1228 ThrowConvertInvalidArgumentException(option,argv[i]);
1231 if (LocaleCompare(
"crop",option+1) == 0)
1236 if (i == (ssize_t) argc)
1237 ThrowConvertException(OptionError,
"MissingArgument",option);
1238 if (IsGeometry(argv[i]) == MagickFalse)
1239 ThrowConvertInvalidArgumentException(option,argv[i]);
1242 if (LocaleCompare(
"cycle",option+1) == 0)
1247 if (i == (ssize_t) argc)
1248 ThrowConvertException(OptionError,
"MissingArgument",option);
1249 if (IsGeometry(argv[i]) == MagickFalse)
1250 ThrowConvertInvalidArgumentException(option,argv[i]);
1253 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1257 if (LocaleCompare(
"decipher",option+1) == 0)
1262 if (i == (ssize_t) argc)
1263 ThrowConvertException(OptionError,
"MissingArgument",option);
1266 if (LocaleCompare(
"deconstruct",option+1) == 0)
1268 if (LocaleCompare(
"debug",option+1) == 0)
1276 if (i == (ssize_t) argc)
1277 ThrowConvertException(OptionError,
"MissingArgument",option);
1278 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
1280 ThrowConvertException(OptionError,
"UnrecognizedEventType",
1282 (void) SetLogEventMask(argv[i]);
1285 if (LocaleCompare(
"define",option+1) == 0)
1288 if (i == (ssize_t) argc)
1289 ThrowConvertException(OptionError,
"MissingArgument",option);
1295 define=GetImageOption(image_info,argv[i]);
1296 if (define == (
const char *) NULL)
1297 ThrowConvertException(OptionError,
"NoSuchOption",argv[i]);
1302 if (LocaleCompare(
"delay",option+1) == 0)
1307 if (i == (ssize_t) argc)
1308 ThrowConvertException(OptionError,
"MissingArgument",option);
1309 if (IsGeometry(argv[i]) == MagickFalse)
1310 ThrowConvertInvalidArgumentException(option,argv[i]);
1313 if (LocaleCompare(
"density",option+1) == 0)
1318 if (i == (ssize_t) argc)
1319 ThrowConvertException(OptionError,
"MissingArgument",option);
1320 if (IsGeometry(argv[i]) == MagickFalse)
1321 ThrowConvertInvalidArgumentException(option,argv[i]);
1324 if (LocaleCompare(
"depth",option+1) == 0)
1329 if (i == (ssize_t) argc)
1330 ThrowConvertException(OptionError,
"MissingArgument",option);
1331 if (IsGeometry(argv[i]) == MagickFalse)
1332 ThrowConvertInvalidArgumentException(option,argv[i]);
1335 if (LocaleCompare(
"delete",option+1) == 0)
1340 if (i == (ssize_t) argc)
1341 ThrowConvertException(OptionError,
"MissingArgument",option);
1342 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1343 ThrowConvertInvalidArgumentException(option,argv[i]);
1346 if (LocaleCompare(
"deskew",option+1) == 0)
1351 if (i == (ssize_t) argc)
1352 ThrowConvertException(OptionError,
"MissingArgument",option);
1353 if (IsGeometry(argv[i]) == MagickFalse)
1354 ThrowConvertInvalidArgumentException(option,argv[i]);
1357 if (LocaleCompare(
"despeckle",option+1) == 0)
1359 if (LocaleCompare(
"direction",option+1) == 0)
1367 if (i == (ssize_t) argc)
1368 ThrowConvertException(OptionError,
"MissingArgument",option);
1369 direction=ParseCommandOption(MagickDirectionOptions,MagickFalse,
1372 ThrowConvertException(OptionError,
"UnrecognizedDirectionType",
1376 if (LocaleCompare(
"display",option+1) == 0)
1381 if (i == (ssize_t) argc)
1382 ThrowConvertException(OptionError,
"MissingArgument",option);
1385 if (LocaleCompare(
"dispose",option+1) == 0)
1393 if (i == (ssize_t) argc)
1394 ThrowConvertException(OptionError,
"MissingArgument",option);
1395 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1397 ThrowConvertException(OptionError,
"UnrecognizedDisposeMethod",
1401 if (LocaleCompare(
"distort",option+1) == 0)
1407 if (i == (ssize_t) argc)
1408 ThrowConvertException(OptionError,
"MissingArgument",option);
1409 op=ParseCommandOption(MagickDistortOptions,MagickFalse,argv[i]);
1411 ThrowConvertException(OptionError,
"UnrecognizedDistortMethod",
1414 if (i == (ssize_t) argc)
1415 ThrowConvertException(OptionError,
"MissingArgument",option);
1418 if (LocaleCompare(
"dither",option+1) == 0)
1426 if (i == (ssize_t) argc)
1427 ThrowConvertException(OptionError,
"MissingArgument",option);
1428 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1430 ThrowConvertException(OptionError,
"UnrecognizedDitherMethod",
1434 if (LocaleCompare(
"draw",option+1) == 0)
1439 if (i == (ssize_t) argc)
1440 ThrowConvertException(OptionError,
"MissingArgument",option);
1443 if (LocaleCompare(
"duplicate",option+1) == 0)
1448 if (i == (ssize_t) argc)
1449 ThrowConvertException(OptionError,
"MissingArgument",option);
1450 if (IsGeometry(argv[i]) == MagickFalse)
1451 ThrowConvertInvalidArgumentException(option,argv[i]);
1454 if (LocaleCompare(
"duration",option+1) == 0)
1459 if (i == (ssize_t) argc)
1460 ThrowConvertException(OptionError,
"MissingArgument",option);
1461 if (IsGeometry(argv[i]) == MagickFalse)
1462 ThrowConvertInvalidArgumentException(option,argv[i]);
1465 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1469 if (LocaleCompare(
"edge",option+1) == 0)
1474 if (i == (ssize_t) argc)
1475 ThrowConvertException(OptionError,
"MissingArgument",option);
1476 if (IsGeometry(argv[i]) == MagickFalse)
1477 ThrowConvertInvalidArgumentException(option,argv[i]);
1480 if (LocaleCompare(
"emboss",option+1) == 0)
1485 if (i == (ssize_t) argc)
1486 ThrowConvertException(OptionError,
"MissingArgument",option);
1487 if (IsGeometry(argv[i]) == MagickFalse)
1488 ThrowConvertInvalidArgumentException(option,argv[i]);
1491 if (LocaleCompare(
"encipher",option+1) == 0)
1496 if (i == (ssize_t) argc)
1497 ThrowConvertException(OptionError,
"MissingArgument",option);
1500 if (LocaleCompare(
"encoding",option+1) == 0)
1505 if (i == (ssize_t) argc)
1506 ThrowConvertException(OptionError,
"MissingArgument",option);
1509 if (LocaleCompare(
"endian",option+1) == 0)
1517 if (i == (ssize_t) argc)
1518 ThrowConvertException(OptionError,
"MissingArgument",option);
1519 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1522 ThrowConvertException(OptionError,
"UnrecognizedEndianType",
1526 if (LocaleCompare(
"enhance",option+1) == 0)
1528 if (LocaleCompare(
"equalize",option+1) == 0)
1530 if (LocaleCompare(
"evaluate",option+1) == 0)
1538 if (i == (ssize_t) argc)
1539 ThrowConvertException(OptionError,
"MissingArgument",option);
1540 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1542 ThrowConvertException(OptionError,
"UnrecognizedEvaluateOperator",
1545 if (i == (ssize_t) argc)
1546 ThrowConvertException(OptionError,
"MissingArgument",option);
1547 if (IsGeometry(argv[i]) == MagickFalse)
1548 ThrowConvertInvalidArgumentException(option,argv[i]);
1551 if (LocaleCompare(
"evaluate-sequence",option+1) == 0)
1559 if (i == (ssize_t) argc)
1560 ThrowConvertException(OptionError,
"MissingArgument",option);
1561 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1563 ThrowConvertException(OptionError,
"UnrecognizedEvaluateOperator",
1567 if (LocaleCompare(
"extent",option+1) == 0)
1572 if (i == (ssize_t) argc)
1573 ThrowConvertException(OptionError,
"MissingArgument",option);
1574 if (IsGeometry(argv[i]) == MagickFalse)
1575 ThrowConvertInvalidArgumentException(option,argv[i]);
1578 if (LocaleCompare(
"extract",option+1) == 0)
1583 if (i == (ssize_t) argc)
1584 ThrowConvertException(OptionError,
"MissingArgument",option);
1585 if (IsGeometry(argv[i]) == MagickFalse)
1586 ThrowConvertInvalidArgumentException(option,argv[i]);
1589 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1593 if (LocaleCompare(
"family",option+1) == 0)
1598 if (i == (ssize_t) argc)
1599 ThrowConvertException(OptionError,
"MissingArgument",option);
1602 if (LocaleCompare(
"features",option+1) == 0)
1607 if (i == (ssize_t) argc)
1608 ThrowConvertException(OptionError,
"MissingArgument",option);
1609 if (IsGeometry(argv[i]) == MagickFalse)
1610 ThrowConvertInvalidArgumentException(option,argv[i]);
1613 if (LocaleCompare(
"fft",option+1) == 0)
1615 if (LocaleCompare(
"fill",option+1) == 0)
1620 if (i == (ssize_t) argc)
1621 ThrowConvertException(OptionError,
"MissingArgument",option);
1624 if (LocaleCompare(
"filter",option+1) == 0)
1632 if (i == (ssize_t) argc)
1633 ThrowConvertException(OptionError,
"MissingArgument",option);
1634 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1636 ThrowConvertException(OptionError,
"UnrecognizedImageFilter",
1640 if (LocaleCompare(
"flatten",option+1) == 0)
1642 if (LocaleCompare(
"flip",option+1) == 0)
1644 if (LocaleCompare(
"flop",option+1) == 0)
1646 if (LocaleCompare(
"floodfill",option+1) == 0)
1651 if (i == (ssize_t) argc)
1652 ThrowConvertException(OptionError,
"MissingArgument",option);
1653 if (IsGeometry(argv[i]) == MagickFalse)
1654 ThrowConvertInvalidArgumentException(option,argv[i]);
1656 if (i == (ssize_t) argc)
1657 ThrowConvertException(OptionError,
"MissingArgument",option);
1660 if (LocaleCompare(
"font",option+1) == 0)
1665 if (i == (ssize_t) argc)
1666 ThrowConvertException(OptionError,
"MissingArgument",option);
1669 if (LocaleCompare(
"format",option+1) == 0)
1674 if (i == (ssize_t) argc)
1675 ThrowConvertException(OptionError,
"MissingArgument",option);
1679 if (LocaleCompare(
"frame",option+1) == 0)
1684 if (i == (ssize_t) argc)
1685 ThrowConvertException(OptionError,
"MissingArgument",option);
1686 if (IsGeometry(argv[i]) == MagickFalse)
1687 ThrowConvertInvalidArgumentException(option,argv[i]);
1690 if (LocaleCompare(
"function",option+1) == 0)
1698 if (i == (ssize_t) argc)
1699 ThrowConvertException(OptionError,
"MissingArgument",option);
1700 op=ParseCommandOption(MagickFunctionOptions,MagickFalse,argv[i]);
1702 ThrowConvertException(OptionError,
"UnrecognizedFunction",argv[i]);
1704 if (i == (ssize_t) argc)
1705 ThrowConvertException(OptionError,
"MissingArgument",option);
1708 if (LocaleCompare(
"fuzz",option+1) == 0)
1713 if (i == (ssize_t) argc)
1714 ThrowConvertException(OptionError,
"MissingArgument",option);
1715 if (IsGeometry(argv[i]) == MagickFalse)
1716 ThrowConvertInvalidArgumentException(option,argv[i]);
1719 if (LocaleCompare(
"fx",option+1) == 0)
1722 if (i == (ssize_t) argc)
1723 ThrowConvertException(OptionError,
"MissingArgument",option);
1726 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1730 if (LocaleCompare(
"gamma",option+1) == 0)
1733 if (i == (ssize_t) argc)
1734 ThrowConvertException(OptionError,
"MissingArgument",option);
1735 if (IsGeometry(argv[i]) == MagickFalse)
1736 ThrowConvertInvalidArgumentException(option,argv[i]);
1739 if ((LocaleCompare(
"gaussian-blur",option+1) == 0) ||
1740 (LocaleCompare(
"gaussian",option+1) == 0))
1743 if (i == (ssize_t) argc)
1744 ThrowConvertException(OptionError,
"MissingArgument",option);
1745 if (IsGeometry(argv[i]) == MagickFalse)
1746 ThrowConvertInvalidArgumentException(option,argv[i]);
1749 if (LocaleCompare(
"geometry",option+1) == 0)
1754 if (i == (ssize_t) argc)
1755 ThrowConvertException(OptionError,
"MissingArgument",option);
1756 if (IsGeometry(argv[i]) == MagickFalse)
1757 ThrowConvertInvalidArgumentException(option,argv[i]);
1760 if (LocaleCompare(
"gravity",option+1) == 0)
1768 if (i == (ssize_t) argc)
1769 ThrowConvertException(OptionError,
"MissingArgument",option);
1770 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1773 ThrowConvertException(OptionError,
"UnrecognizedGravityType",
1777 if (LocaleCompare(
"grayscale",option+1) == 0)
1785 if (i == (ssize_t) argc)
1786 ThrowConvertException(OptionError,
"MissingArgument",option);
1787 method=ParseCommandOption(MagickPixelIntensityOptions,MagickFalse,
1790 ThrowConvertException(OptionError,
"UnrecognizedIntensityMethod",
1794 if (LocaleCompare(
"green-primary",option+1) == 0)
1799 if (i == (ssize_t) argc)
1800 ThrowConvertException(OptionError,
"MissingArgument",option);
1801 if (IsGeometry(argv[i]) == MagickFalse)
1802 ThrowConvertInvalidArgumentException(option,argv[i]);
1805 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1809 if (LocaleCompare(
"hald-clut",option+1) == 0)
1811 if ((LocaleCompare(
"help",option+1) == 0) ||
1812 (LocaleCompare(
"-help",option+1) == 0))
1815 return(ConvertUsage());
1817 if (LocaleCompare(
"hough-lines",option+1) == 0)
1822 if (i == (ssize_t) argc)
1823 ThrowConvertException(OptionError,
"MissingArgument",option);
1824 if (IsGeometry(argv[i]) == MagickFalse)
1825 ThrowConvertInvalidArgumentException(option,argv[i]);
1828 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1832 if (LocaleCompare(
"identify",option+1) == 0)
1834 if (LocaleCompare(
"ift",option+1) == 0)
1836 if (LocaleCompare(
"illuminant",option+1) == 0)
1844 if (i == (ssize_t) argc)
1845 ThrowConvertException(OptionError,
"MissingArgument",option);
1846 type=ParseCommandOption(MagickIlluminantOptions,MagickFalse,
1849 ThrowConvertException(OptionError,
"UnrecognizedIlluminantMethod",
1853 if (LocaleCompare(
"implode",option+1) == 0)
1858 if (i == (ssize_t) argc)
1859 ThrowConvertException(OptionError,
"MissingArgument",option);
1860 if (IsGeometry(argv[i]) == MagickFalse)
1861 ThrowConvertInvalidArgumentException(option,argv[i]);
1864 if (LocaleCompare(
"insert",option+1) == 0)
1869 if (i == (ssize_t) argc)
1870 ThrowConvertException(OptionError,
"MissingArgument",option);
1871 if (IsGeometry(argv[i]) == MagickFalse)
1872 ThrowConvertInvalidArgumentException(option,argv[i]);
1875 if (LocaleCompare(
"integral",option+1) == 0)
1877 if (LocaleCompare(
"intensity",option+1) == 0)
1885 if (i == (ssize_t) argc)
1886 ThrowConvertException(OptionError,
"MissingArgument",option);
1887 intensity=ParseCommandOption(MagickPixelIntensityOptions,
1888 MagickFalse,argv[i]);
1890 ThrowConvertException(OptionError,
"UnrecognizedIntensityMethod",
1894 if (LocaleCompare(
"intent",option+1) == 0)
1902 if (i == (ssize_t) argc)
1903 ThrowConvertException(OptionError,
"MissingArgument",option);
1904 intent=ParseCommandOption(MagickIntentOptions,MagickFalse,argv[i]);
1906 ThrowConvertException(OptionError,
"UnrecognizedIntentType",argv[i]);
1909 if (LocaleCompare(
"interlace",option+1) == 0)
1917 if (i == (ssize_t) argc)
1918 ThrowConvertException(OptionError,
"MissingArgument",option);
1919 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1922 ThrowConvertException(OptionError,
"UnrecognizedInterlaceType",
1926 if (LocaleCompare(
"interline-spacing",option+1) == 0)
1931 if (i == (ssize_t) argc)
1932 ThrowConvertException(OptionError,
"MissingArgument",option);
1933 if (IsGeometry(argv[i]) == MagickFalse)
1934 ThrowConvertInvalidArgumentException(option,argv[i]);
1937 if (LocaleCompare(
"interpolate",option+1) == 0)
1945 if (i == (ssize_t) argc)
1946 ThrowConvertException(OptionError,
"MissingArgument",option);
1947 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1949 if (interpolate < 0)
1950 ThrowConvertException(OptionError,
"UnrecognizedInterpolateMethod",
1954 if (LocaleCompare(
"interword-spacing",option+1) == 0)
1959 if (i == (ssize_t) argc)
1960 ThrowConvertException(OptionError,
"MissingArgument",option);
1961 if (IsGeometry(argv[i]) == MagickFalse)
1962 ThrowConvertInvalidArgumentException(option,argv[i]);
1965 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1969 if (LocaleCompare(
"kerning",option+1) == 0)
1974 if (i == (ssize_t) argc)
1975 ThrowConvertException(OptionError,
"MissingArgument",option);
1976 if (IsGeometry(argv[i]) == MagickFalse)
1977 ThrowConvertInvalidArgumentException(option,argv[i]);
1980 if (LocaleCompare(
"kmeans",option+1) == 0)
1985 if (i == (ssize_t) argc)
1986 ThrowConvertException(OptionError,
"MissingArgument",option);
1987 if (IsGeometry(argv[i]) == MagickFalse)
1988 ThrowConvertInvalidArgumentException(option,argv[i]);
1991 if (LocaleCompare(
"kuwahara",option+1) == 0)
1996 if (i == (ssize_t) argc)
1997 ThrowConvertException(OptionError,
"MissingArgument",option);
1998 if (IsGeometry(argv[i]) == MagickFalse)
1999 ThrowConvertInvalidArgumentException(option,argv[i]);
2002 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2006 if (LocaleCompare(
"label",option+1) == 0)
2011 if (i == (ssize_t) argc)
2012 ThrowConvertException(OptionError,
"MissingArgument",option);
2015 if (LocaleCompare(
"lat",option+1) == 0)
2020 if (i == (ssize_t) argc)
2021 ThrowConvertException(OptionError,
"MissingArgument",option);
2022 if (IsGeometry(argv[i]) == MagickFalse)
2023 ThrowConvertInvalidArgumentException(option,argv[i]);
2026 if (LocaleCompare(
"layers",option+1) == 0)
2034 if (i == (ssize_t) argc)
2035 ThrowConvertException(OptionError,
"MissingArgument",option);
2036 type=ParseCommandOption(MagickLayerOptions,MagickFalse,argv[i]);
2038 ThrowConvertException(OptionError,
"UnrecognizedLayerMethod",
2042 if (LocaleCompare(
"level",option+1) == 0)
2045 if (i == (ssize_t) argc)
2046 ThrowConvertException(OptionError,
"MissingArgument",option);
2047 if (IsGeometry(argv[i]) == MagickFalse)
2048 ThrowConvertInvalidArgumentException(option,argv[i]);
2051 if (LocaleCompare(
"level-colors",option+1) == 0)
2054 if (i == (ssize_t) argc)
2055 ThrowConvertException(OptionError,
"MissingArgument",option);
2058 if (LocaleCompare(
"limit",option+1) == 0)
2072 if (i == (ssize_t) argc)
2073 ThrowConvertException(OptionError,
"MissingArgument",option);
2074 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
2077 ThrowConvertException(OptionError,
"UnrecognizedResourceType",
2080 if (i == (ssize_t) argc)
2081 ThrowConvertException(OptionError,
"MissingArgument",option);
2082 value=StringToDouble(argv[i],&p);
2084 if ((p == argv[i]) && (LocaleCompare(
"unlimited",argv[i]) != 0))
2085 ThrowConvertInvalidArgumentException(option,argv[i]);
2088 if (LocaleCompare(
"linear-stretch",option+1) == 0)
2091 if (i == (ssize_t) argc)
2092 ThrowConvertException(OptionError,
"MissingArgument",option);
2093 if (IsGeometry(argv[i]) == MagickFalse)
2094 ThrowConvertInvalidArgumentException(option,argv[i]);
2097 if (LocaleCompare(
"liquid-rescale",option+1) == 0)
2100 if (i == (ssize_t) argc)
2101 ThrowConvertException(OptionError,
"MissingArgument",option);
2102 if (IsGeometry(argv[i]) == MagickFalse)
2103 ThrowConvertInvalidArgumentException(option,argv[i]);
2106 if (LocaleCompare(
"list",option+1) == 0)
2114 if (i == (ssize_t) argc)
2115 ThrowConvertException(OptionError,
"MissingArgument",option);
2116 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
2118 ThrowConvertException(OptionError,
"UnrecognizedListType",argv[i]);
2119 status=MogrifyImageInfo(image_info,(
int) (i-j+1),(
const char **)
2122 return(status == 0 ? MagickFalse : MagickTrue);
2124 if (LocaleCompare(
"local-contrast",option+1) == 0)
2127 if (i == (ssize_t)argc)
2128 ThrowConvertException(OptionError,
"MissingArgument", option);
2129 if (IsGeometry(argv[i]) == MagickFalse)
2130 ThrowConvertInvalidArgumentException(option,argv[i]);
2133 if (LocaleCompare(
"log",option+1) == 0)
2138 if ((i == (ssize_t) argc) ||
2139 (strchr(argv[i],
'%') == (
char *) NULL))
2140 ThrowConvertException(OptionError,
"MissingArgument",option);
2143 if (LocaleCompare(
"loop",option+1) == 0)
2148 if (i == (ssize_t) argc)
2149 ThrowConvertException(OptionError,
"MissingArgument",option);
2150 if (IsGeometry(argv[i]) == MagickFalse)
2151 ThrowConvertInvalidArgumentException(option,argv[i]);
2154 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2158 if (LocaleCompare(
"magnify",option+1) == 0)
2160 if (LocaleCompare(
"map",option+1) == 0)
2165 if (i == (ssize_t) argc)
2166 ThrowConvertException(OptionError,
"MissingArgument",option);
2169 if (LocaleCompare(
"mask",option+1) == 0)
2174 if (i == (ssize_t) argc)
2175 ThrowConvertException(OptionError,
"MissingArgument",option);
2178 if (LocaleCompare(
"matte",option+1) == 0)
2180 if (LocaleCompare(
"mattecolor",option+1) == 0)
2185 if (i == (ssize_t)argc)
2186 ThrowConvertException(OptionError,
"MissingArgument", option);
2189 if (LocaleCompare(
"maximum",option+1) == 0)
2191 if (LocaleCompare(
"mean-shift",option+1) == 0)
2196 if (i == (ssize_t) argc)
2197 ThrowConvertException(OptionError,
"MissingArgument",option);
2198 if (IsGeometry(argv[i]) == MagickFalse)
2199 ThrowConvertInvalidArgumentException(option,argv[i]);
2202 if (LocaleCompare(
"median",option+1) == 0)
2207 if (i == (ssize_t) argc)
2208 ThrowConvertException(OptionError,
"MissingArgument",option);
2209 if (IsGeometry(argv[i]) == MagickFalse)
2210 ThrowConvertInvalidArgumentException(option,argv[i]);
2213 if (LocaleCompare(
"metric",option+1) == 0)
2221 if (i == (ssize_t) argc)
2222 ThrowConvertException(OptionError,
"MissingArgument",option);
2223 type=ParseCommandOption(MagickMetricOptions,MagickTrue,argv[i]);
2225 ThrowConvertException(OptionError,
"UnrecognizedMetricType",
2229 if (LocaleCompare(
"minimum",option+1) == 0)
2231 if (LocaleCompare(
"mode",option+1) == 0)
2236 if (i == (ssize_t) argc)
2237 ThrowConvertException(OptionError,
"MissingArgument",option);
2238 if (IsGeometry(argv[i]) == MagickFalse)
2239 ThrowConvertInvalidArgumentException(option,argv[i]);
2242 if (LocaleCompare(
"modulate",option+1) == 0)
2247 if (i == (ssize_t) argc)
2248 ThrowConvertException(OptionError,
"MissingArgument",option);
2249 if (IsGeometry(argv[i]) == MagickFalse)
2250 ThrowConvertInvalidArgumentException(option,argv[i]);
2253 if (LocaleCompare(
"moments",option+1) == 0)
2255 if (LocaleCompare(
"monitor",option+1) == 0)
2257 if (LocaleCompare(
"monochrome",option+1) == 0)
2259 if (LocaleCompare(
"morph",option+1) == 0)
2264 if (i == (ssize_t) argc)
2265 ThrowConvertException(OptionError,
"MissingArgument",option);
2266 if (IsGeometry(argv[i]) == MagickFalse)
2267 ThrowConvertInvalidArgumentException(option,argv[i]);
2270 if (LocaleCompare(
"morphology",option+1) == 0)
2273 token[MagickPathExtent];
2282 if (i == (ssize_t) argc)
2283 ThrowConvertException(OptionError,
"MissingArgument",option);
2284 (void) GetNextToken(argv[i],(
const char **) NULL,MagickPathExtent,token);
2285 op=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
2287 ThrowConvertException(OptionError,
"UnrecognizedMorphologyMethod",
2290 if (i == (ssize_t) argc)
2291 ThrowConvertException(OptionError,
"MissingArgument",option);
2292 kernel_info=AcquireKernelInfo(argv[i],exception);
2293 if (kernel_info == (KernelInfo *) NULL)
2294 ThrowConvertInvalidArgumentException(option,argv[i]);
2295 kernel_info=DestroyKernelInfo(kernel_info);
2298 if (LocaleCompare(
"mosaic",option+1) == 0)
2300 if (LocaleCompare(
"motion-blur",option+1) == 0)
2305 if (i == (ssize_t) argc)
2306 ThrowConvertException(OptionError,
"MissingArgument",option);
2307 if (IsGeometry(argv[i]) == MagickFalse)
2308 ThrowConvertInvalidArgumentException(option,argv[i]);
2311 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2315 if (LocaleCompare(
"negate",option+1) == 0)
2317 if (LocaleCompare(
"noise",option+1) == 0)
2320 if (i == (ssize_t) argc)
2321 ThrowConvertException(OptionError,
"MissingArgument",option);
2327 noise=ParseCommandOption(MagickNoiseOptions,MagickFalse,
2330 ThrowConvertException(OptionError,
"UnrecognizedNoiseType",
2334 if (IsGeometry(argv[i]) == MagickFalse)
2335 ThrowConvertInvalidArgumentException(option,argv[i]);
2338 if (LocaleCompare(
"noop",option+1) == 0)
2340 if (LocaleCompare(
"normalize",option+1) == 0)
2342 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2346 if (LocaleCompare(
"opaque",option+1) == 0)
2349 if (i == (ssize_t) argc)
2350 ThrowConvertException(OptionError,
"MissingArgument",option);
2353 if (LocaleCompare(
"ordered-dither",option+1) == 0)
2358 if (i == (ssize_t) argc)
2359 ThrowConvertException(OptionError,
"MissingArgument",option);
2362 if (LocaleCompare(
"orient",option+1) == 0)
2370 if (i == (ssize_t) argc)
2371 ThrowConvertException(OptionError,
"MissingArgument",option);
2372 orientation=ParseCommandOption(MagickOrientationOptions,
2373 MagickFalse,argv[i]);
2374 if (orientation < 0)
2375 ThrowConvertException(OptionError,
"UnrecognizedImageOrientation",
2379 ThrowConvertException(OptionError,
"UnrecognizedOption",argv[i])
2383 if (LocaleCompare(
"page",option+1) == 0)
2388 if (i == (ssize_t) argc)
2389 ThrowConvertException(OptionError,
"MissingArgument",option);
2392 if (LocaleCompare(
"paint",option+1) == 0)
2397 if (i == (ssize_t) argc)
2398 ThrowConvertException(OptionError,
"MissingArgument",option);
2399 if (IsGeometry(argv[i]) == MagickFalse)
2400 ThrowConvertInvalidArgumentException(option,argv[i]);
2403 if (LocaleCompare(
"perceptible",option+1) == 0)
2408 if (i == (ssize_t) argc)
2409 ThrowConvertException(OptionError,
"MissingArgument",option);
2410 if (IsGeometry(argv[i]) == MagickFalse)
2411 ThrowConvertInvalidArgumentException(option,argv[i]);
2414 if (LocaleCompare(
"ping",option+1) == 0)
2416 if (LocaleCompare(
"pointsize",option+1) == 0)
2421 if (i == (ssize_t) argc)
2422 ThrowConvertException(OptionError,
"MissingArgument",option);
2423 if (IsGeometry(argv[i]) == MagickFalse)
2424 ThrowConvertInvalidArgumentException(option,argv[i]);
2427 if (LocaleCompare(
"polaroid",option+1) == 0)
2432 if (i == (ssize_t) argc)
2433 ThrowConvertException(OptionError,
"MissingArgument",option);
2434 if (IsGeometry(argv[i]) == MagickFalse)
2435 ThrowConvertInvalidArgumentException(option,argv[i]);
2438 if (LocaleCompare(
"poly",option+1) == 0)
2443 if (i == (ssize_t) argc)
2444 ThrowConvertException(OptionError,
"MissingArgument",option);
2445 if (IsGeometry(argv[i]) == MagickFalse)
2446 ThrowConvertInvalidArgumentException(option,argv[i]);
2449 if (LocaleCompare(
"posterize",option+1) == 0)
2454 if (i == (ssize_t) argc)
2455 ThrowConvertException(OptionError,
"MissingArgument",option);
2456 if (IsGeometry(argv[i]) == MagickFalse)
2457 ThrowConvertInvalidArgumentException(option,argv[i]);
2460 if (LocaleCompare(
"precision",option+1) == 0)
2465 if (i == (ssize_t) argc)
2466 ThrowConvertException(OptionError,
"MissingArgument",option);
2467 if (IsGeometry(argv[i]) == MagickFalse)
2468 ThrowConvertInvalidArgumentException(option,argv[i]);
2471 if (LocaleCompare(
"preview",option+1) == 0)
2479 if (i == (ssize_t) argc)
2480 ThrowConvertException(OptionError,
"MissingArgument",option);
2481 preview=ParseCommandOption(MagickPreviewOptions,MagickFalse,
2484 ThrowConvertException(OptionError,
"UnrecognizedPreviewType",
2488 if (LocaleCompare(
"print",option+1) == 0)
2493 if (i == (ssize_t) argc)
2494 ThrowConvertException(OptionError,
"MissingArgument",option);
2497 if (LocaleCompare(
"process",option+1) == 0)
2502 if (i == (ssize_t) argc)
2503 ThrowConvertException(OptionError,
"MissingArgument",option);
2506 if (LocaleCompare(
"profile",option+1) == 0)
2509 if (i == (ssize_t) argc)
2510 ThrowConvertException(OptionError,
"MissingArgument",option);
2513 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2517 if (LocaleCompare(
"quality",option+1) == 0)
2522 if (i == (ssize_t) argc)
2523 ThrowConvertException(OptionError,
"MissingArgument",option);
2524 if (IsGeometry(argv[i]) == MagickFalse)
2525 ThrowConvertInvalidArgumentException(option,argv[i]);
2528 if (LocaleCompare(
"quantize",option+1) == 0)
2536 if (i == (ssize_t) argc)
2537 ThrowConvertException(OptionError,
"MissingArgument",option);
2538 colorspace=ParseCommandOption(MagickColorspaceOptions,
2539 MagickFalse,argv[i]);
2541 ThrowConvertException(OptionError,
"UnrecognizedColorspace",
2545 if (LocaleCompare(
"quiet",option+1) == 0)
2547 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2551 if (LocaleCompare(
"rotational-blur",option+1) == 0)
2554 if (i == (ssize_t) argc)
2555 ThrowConvertException(OptionError,
"MissingArgument",option);
2556 if (IsGeometry(argv[i]) == MagickFalse)
2557 ThrowConvertInvalidArgumentException(option,argv[i]);
2560 if (LocaleCompare(
"raise",option+1) == 0)
2563 if (i == (ssize_t) argc)
2564 ThrowConvertException(OptionError,
"MissingArgument",option);
2565 if (IsGeometry(argv[i]) == MagickFalse)
2566 ThrowConvertInvalidArgumentException(option,argv[i]);
2569 if (LocaleCompare(
"random-threshold",option+1) == 0)
2574 if (i == (ssize_t) argc)
2575 ThrowConvertException(OptionError,
"MissingArgument",option);
2576 if (IsGeometry(argv[i]) == MagickFalse)
2577 ThrowConvertInvalidArgumentException(option,argv[i]);
2580 if (LocaleCompare(
"range-threshold",option+1) == 0)
2585 if (i == (ssize_t) argc)
2586 ThrowConvertException(OptionError,
"MissingArgument",option);
2587 if (IsGeometry(argv[i]) == MagickFalse)
2588 ThrowConvertInvalidArgumentException(option,argv[i]);
2591 if (LocaleCompare(
"read-mask",option+1) == 0)
2596 if (i == (ssize_t) argc)
2597 ThrowConvertException(OptionError,
"MissingArgument",option);
2600 if (LocaleCompare(
"red-primary",option+1) == 0)
2605 if (i == (ssize_t) argc)
2606 ThrowConvertException(OptionError,
"MissingArgument",option);
2607 if (IsGeometry(argv[i]) == MagickFalse)
2608 ThrowConvertInvalidArgumentException(option,argv[i]);
2611 if (LocaleCompare(
"regard-warnings",option+1) == 0)
2613 if (LocaleCompare(
"region",option+1) == 0)
2618 if (i == (ssize_t) argc)
2619 ThrowConvertException(OptionError,
"MissingArgument",option);
2620 if (IsGeometry(argv[i]) == MagickFalse)
2621 ThrowConvertInvalidArgumentException(option,argv[i]);
2624 if (LocaleCompare(
"remap",option+1) == 0)
2629 if (i == (ssize_t) argc)
2630 ThrowConvertException(OptionError,
"MissingArgument",option);
2633 if (LocaleCompare(
"render",option+1) == 0)
2635 if (LocaleCompare(
"repage",option+1) == 0)
2640 if (i == (ssize_t) argc)
2641 ThrowConvertException(OptionError,
"MissingArgument",option);
2642 if (IsGeometry(argv[i]) == MagickFalse)
2643 ThrowConvertInvalidArgumentException(option,argv[i]);
2646 if (LocaleCompare(
"resample",option+1) == 0)
2651 if (i == (ssize_t) argc)
2652 ThrowConvertException(OptionError,
"MissingArgument",option);
2653 if (IsGeometry(argv[i]) == MagickFalse)
2654 ThrowConvertInvalidArgumentException(option,argv[i]);
2657 if (LocaleCompare(
"reshape",option+1) == 0)
2662 if (i == (ssize_t) argc)
2663 ThrowConvertException(OptionError,
"MissingArgument",option);
2664 if (IsGeometry(argv[i]) == MagickFalse)
2665 ThrowConvertInvalidArgumentException(option,argv[i]);
2668 if (LocaleCompare(
"resize",option+1) == 0)
2673 if (i == (ssize_t) argc)
2674 ThrowConvertException(OptionError,
"MissingArgument",option);
2675 if (IsGeometry(argv[i]) == MagickFalse)
2676 ThrowConvertInvalidArgumentException(option,argv[i]);
2679 if (LocaleNCompare(
"respect-parentheses",option+1,17) == 0)
2681 respect_parenthesis=(*option ==
'-') ? MagickTrue : MagickFalse;
2684 if (LocaleCompare(
"reverse",option+1) == 0)
2686 if (LocaleCompare(
"roll",option+1) == 0)
2691 if (i == (ssize_t) argc)
2692 ThrowConvertException(OptionError,
"MissingArgument",option);
2693 if (IsGeometry(argv[i]) == MagickFalse)
2694 ThrowConvertInvalidArgumentException(option,argv[i]);
2697 if (LocaleCompare(
"rotate",option+1) == 0)
2700 if (i == (ssize_t) argc)
2701 ThrowConvertException(OptionError,
"MissingArgument",option);
2702 if (IsGeometry(argv[i]) == MagickFalse)
2703 ThrowConvertInvalidArgumentException(option,argv[i]);
2706 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2710 if (LocaleCompare(
"sample",option+1) == 0)
2715 if (i == (ssize_t) argc)
2716 ThrowConvertException(OptionError,
"MissingArgument",option);
2717 if (IsGeometry(argv[i]) == MagickFalse)
2718 ThrowConvertInvalidArgumentException(option,argv[i]);
2721 if (LocaleCompare(
"sampling-factor",option+1) == 0)
2726 if (i == (ssize_t) argc)
2727 ThrowConvertException(OptionError,
"MissingArgument",option);
2728 if (IsGeometry(argv[i]) == MagickFalse)
2729 ThrowConvertInvalidArgumentException(option,argv[i]);
2732 if (LocaleCompare(
"scale",option+1) == 0)
2737 if (i == (ssize_t) argc)
2738 ThrowConvertException(OptionError,
"MissingArgument",option);
2739 if (IsGeometry(argv[i]) == MagickFalse)
2740 ThrowConvertInvalidArgumentException(option,argv[i]);
2743 if (LocaleCompare(
"scene",option+1) == 0)
2748 if (i == (ssize_t) argc)
2749 ThrowConvertException(OptionError,
"MissingArgument",option);
2750 if (IsGeometry(argv[i]) == MagickFalse)
2751 ThrowConvertInvalidArgumentException(option,argv[i]);
2754 if (LocaleCompare(
"seed",option+1) == 0)
2759 if (i == (ssize_t) argc)
2760 ThrowConvertException(OptionError,
"MissingArgument",option);
2761 if (IsGeometry(argv[i]) == MagickFalse)
2762 ThrowConvertInvalidArgumentException(option,argv[i]);
2765 if (LocaleCompare(
"segment",option+1) == 0)
2770 if (i == (ssize_t) argc)
2771 ThrowConvertException(OptionError,
"MissingArgument",option);
2772 if (IsGeometry(argv[i]) == MagickFalse)
2773 ThrowConvertInvalidArgumentException(option,argv[i]);
2776 if (LocaleCompare(
"selective-blur",option+1) == 0)
2779 if (i == (ssize_t) argc)
2780 ThrowConvertException(OptionError,
"MissingArgument",option);
2781 if (IsGeometry(argv[i]) == MagickFalse)
2782 ThrowConvertInvalidArgumentException(option,argv[i]);
2785 if (LocaleCompare(
"separate",option+1) == 0)
2787 if (LocaleCompare(
"sepia-tone",option+1) == 0)
2792 if (i == (ssize_t) argc)
2793 ThrowConvertException(OptionError,
"MissingArgument",option);
2794 if (IsGeometry(argv[i]) == MagickFalse)
2795 ThrowConvertInvalidArgumentException(option,argv[i]);
2798 if (LocaleCompare(
"set",option+1) == 0)
2801 if (i == (ssize_t) argc)
2802 ThrowConvertException(OptionError,
"MissingArgument",option);
2806 if (i == (ssize_t) argc)
2807 ThrowConvertException(OptionError,
"MissingArgument",option);
2810 if (LocaleCompare(
"shade",option+1) == 0)
2813 if (i == (ssize_t) argc)
2814 ThrowConvertException(OptionError,
"MissingArgument",option);
2815 if (IsGeometry(argv[i]) == MagickFalse)
2816 ThrowConvertInvalidArgumentException(option,argv[i]);
2819 if (LocaleCompare(
"shadow",option+1) == 0)
2824 if (i == (ssize_t) argc)
2825 ThrowConvertException(OptionError,
"MissingArgument",option);
2826 if (IsGeometry(argv[i]) == MagickFalse)
2827 ThrowConvertInvalidArgumentException(option,argv[i]);
2830 if (LocaleCompare(
"sharpen",option+1) == 0)
2833 if (i == (ssize_t) argc)
2834 ThrowConvertException(OptionError,
"MissingArgument",option);
2835 if (IsGeometry(argv[i]) == MagickFalse)
2836 ThrowConvertInvalidArgumentException(option,argv[i]);
2839 if (LocaleCompare(
"shave",option+1) == 0)
2844 if (i == (ssize_t) argc)
2845 ThrowConvertException(OptionError,
"MissingArgument",option);
2846 if (IsGeometry(argv[i]) == MagickFalse)
2847 ThrowConvertInvalidArgumentException(option,argv[i]);
2850 if (LocaleCompare(
"shear",option+1) == 0)
2853 if (i == (ssize_t) argc)
2854 ThrowConvertException(OptionError,
"MissingArgument",option);
2855 if (IsGeometry(argv[i]) == MagickFalse)
2856 ThrowConvertInvalidArgumentException(option,argv[i]);
2859 if (LocaleCompare(
"sigmoidal-contrast",option+1) == 0)
2862 if (i == (ssize_t) argc)
2863 ThrowConvertException(OptionError,
"MissingArgument",option);
2864 if (IsGeometry(argv[i]) == MagickFalse)
2865 ThrowConvertInvalidArgumentException(option,argv[i]);
2868 if (LocaleCompare(
"size",option+1) == 0)
2873 if (i == (ssize_t) argc)
2874 ThrowConvertException(OptionError,
"MissingArgument",option);
2875 if (IsGeometry(argv[i]) == MagickFalse)
2876 ThrowConvertInvalidArgumentException(option,argv[i]);
2879 if (LocaleCompare(
"sketch",option+1) == 0)
2884 if (i == (ssize_t) argc)
2885 ThrowConvertException(OptionError,
"MissingArgument",option);
2886 if (IsGeometry(argv[i]) == MagickFalse)
2887 ThrowConvertInvalidArgumentException(option,argv[i]);
2890 if (LocaleCompare(
"smush",option+1) == 0)
2893 if (i == (ssize_t) argc)
2894 ThrowConvertException(OptionError,
"MissingArgument",option);
2895 if (IsGeometry(argv[i]) == MagickFalse)
2896 ThrowConvertInvalidArgumentException(option,argv[i]);
2899 if (LocaleCompare(
"solarize",option+1) == 0)
2904 if (i == (ssize_t) argc)
2905 ThrowConvertException(OptionError,
"MissingArgument",option);
2906 if (IsGeometry(argv[i]) == MagickFalse)
2907 ThrowConvertInvalidArgumentException(option,argv[i]);
2910 if (LocaleCompare(
"sort-pixels",option+1) == 0)
2912 if (LocaleCompare(
"sparse-color",option+1) == 0)
2918 if (i == (ssize_t) argc)
2919 ThrowConvertException(OptionError,
"MissingArgument",option);
2920 op=ParseCommandOption(MagickSparseColorOptions,MagickFalse,argv[i]);
2922 ThrowConvertException(OptionError,
"UnrecognizedSparseColorMethod",
2925 if (i == (ssize_t) argc)
2926 ThrowConvertException(OptionError,
"MissingArgument",option);
2929 if (LocaleCompare(
"splice",option+1) == 0)
2934 if (i == (ssize_t) argc)
2935 ThrowConvertException(OptionError,
"MissingArgument",option);
2936 if (IsGeometry(argv[i]) == MagickFalse)
2937 ThrowConvertInvalidArgumentException(option,argv[i]);
2940 if (LocaleCompare(
"spread",option+1) == 0)
2945 if ((i == (ssize_t) argc) ||
2946 (IsGeometry(argv[i]) == MagickFalse))
2947 ThrowConvertException(OptionError,
"MissingArgument",option);
2950 if (LocaleCompare(
"statistic",option+1) == 0)
2958 if (i == (ssize_t) argc)
2959 ThrowConvertException(OptionError,
"MissingArgument",option);
2960 op=ParseCommandOption(MagickStatisticOptions,MagickFalse,argv[i]);
2962 ThrowConvertException(OptionError,
"UnrecognizedStatisticType",
2965 if (i == (ssize_t) argc)
2966 ThrowConvertException(OptionError,
"MissingArgument",option);
2967 if (IsGeometry(argv[i]) == MagickFalse)
2968 ThrowConvertInvalidArgumentException(option,argv[i]);
2971 if (LocaleCompare(
"stretch",option+1) == 0)
2979 if (i == (ssize_t) argc)
2980 ThrowConvertException(OptionError,
"MissingArgument",option);
2981 stretch=ParseCommandOption(MagickStretchOptions,MagickFalse,
2984 ThrowConvertException(OptionError,
"UnrecognizedStyleType",
2988 if (LocaleCompare(
"strip",option+1) == 0)
2990 if (LocaleCompare(
"stroke",option+1) == 0)
2995 if (i == (ssize_t) argc)
2996 ThrowConvertException(OptionError,
"MissingArgument",option);
2999 if (LocaleCompare(
"strokewidth",option+1) == 0)
3004 if (i == (ssize_t) argc)
3005 ThrowConvertException(OptionError,
"MissingArgument",option);
3006 if (IsGeometry(argv[i]) == MagickFalse)
3007 ThrowConvertInvalidArgumentException(option,argv[i]);
3010 if (LocaleCompare(
"style",option+1) == 0)
3018 if (i == (ssize_t) argc)
3019 ThrowConvertException(OptionError,
"MissingArgument",option);
3020 style=ParseCommandOption(MagickStyleOptions,MagickFalse,argv[i]);
3022 ThrowConvertException(OptionError,
"UnrecognizedStyleType",
3026 if (LocaleCompare(
"support",option+1) == 0)
3031 if (LocaleCompare(
"swap",option+1) == 0)
3036 if (i == (ssize_t) argc)
3037 ThrowConvertException(OptionError,
"MissingArgument",option);
3038 if (IsGeometry(argv[i]) == MagickFalse)
3039 ThrowConvertInvalidArgumentException(option,argv[i]);
3042 if (LocaleCompare(
"swirl",option+1) == 0)
3047 if (i == (ssize_t) argc)
3048 ThrowConvertException(OptionError,
"MissingArgument",option);
3049 if (IsGeometry(argv[i]) == MagickFalse)
3050 ThrowConvertInvalidArgumentException(option,argv[i]);
3053 if (LocaleCompare(
"synchronize",option+1) == 0)
3055 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3059 if (LocaleCompare(
"taint",option+1) == 0)
3061 if (LocaleCompare(
"texture",option+1) == 0)
3066 if (i == (ssize_t) argc)
3067 ThrowConvertException(OptionError,
"MissingArgument",option);
3070 if (LocaleCompare(
"threshold",option+1) == 0)
3075 if (i == (ssize_t) argc)
3076 ThrowConvertException(OptionError,
"MissingArgument",option);
3077 if (IsGeometry(argv[i]) == MagickFalse)
3078 ThrowConvertInvalidArgumentException(option,argv[i]);
3081 if (LocaleCompare(
"thumbnail",option+1) == 0)
3086 if (i == (ssize_t) argc)
3087 ThrowConvertException(OptionError,
"MissingArgument",option);
3088 if (IsGeometry(argv[i]) == MagickFalse)
3089 ThrowConvertInvalidArgumentException(option,argv[i]);
3092 if (LocaleCompare(
"tile",option+1) == 0)
3097 if (i == (ssize_t) argc)
3098 ThrowConvertException(OptionError,
"MissingArgument",option);
3101 if (LocaleCompare(
"tile-offset",option+1) == 0)
3106 if (i == (ssize_t) argc)
3107 ThrowConvertException(OptionError,
"MissingArgument",option);
3108 if (IsGeometry(argv[i]) == MagickFalse)
3109 ThrowConvertInvalidArgumentException(option,argv[i]);
3112 if (LocaleCompare(
"tint",option+1) == 0)
3117 if (i == (ssize_t) argc)
3118 ThrowConvertException(OptionError,
"MissingArgument",option);
3119 if (IsGeometry(argv[i]) == MagickFalse)
3120 ThrowConvertInvalidArgumentException(option,argv[i]);
3123 if (LocaleCompare(
"transform",option+1) == 0)
3125 if (LocaleCompare(
"transparent",option+1) == 0)
3128 if (i == (ssize_t) argc)
3129 ThrowConvertException(OptionError,
"MissingArgument",option);
3132 if (LocaleCompare(
"transparent-color",option+1) == 0)
3137 if (i == (ssize_t) argc)
3138 ThrowConvertException(OptionError,
"MissingArgument",option);
3141 if (LocaleCompare(
"transpose",option+1) == 0)
3143 if (LocaleCompare(
"transverse",option+1) == 0)
3145 if (LocaleCompare(
"treedepth",option+1) == 0)
3150 if (i == (ssize_t) argc)
3151 ThrowConvertException(OptionError,
"MissingArgument",option);
3152 if (IsGeometry(argv[i]) == MagickFalse)
3153 ThrowConvertInvalidArgumentException(option,argv[i]);
3156 if (LocaleCompare(
"trim",option+1) == 0)
3158 if (LocaleCompare(
"type",option+1) == 0)
3166 if (i == (ssize_t) argc)
3167 ThrowConvertException(OptionError,
"MissingArgument",option);
3168 type=ParseCommandOption(MagickTypeOptions,MagickFalse,argv[i]);
3170 ThrowConvertException(OptionError,
"UnrecognizedImageType",
3174 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3178 if (LocaleCompare(
"undercolor",option+1) == 0)
3183 if (i == (ssize_t) argc)
3184 ThrowConvertException(OptionError,
"MissingArgument",option);
3187 if (LocaleCompare(
"unique-colors",option+1) == 0)
3189 if (LocaleCompare(
"units",option+1) == 0)
3197 if (i == (ssize_t) argc)
3198 ThrowConvertException(OptionError,
"MissingArgument",option);
3199 units=ParseCommandOption(MagickResolutionOptions,MagickFalse,
3202 ThrowConvertException(OptionError,
"UnrecognizedUnitsType",
3206 if (LocaleCompare(
"unsharp",option+1) == 0)
3211 if (i == (ssize_t) argc)
3212 ThrowConvertException(OptionError,
"MissingArgument",option);
3213 if (IsGeometry(argv[i]) == MagickFalse)
3214 ThrowConvertInvalidArgumentException(option,argv[i]);
3217 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3221 if (LocaleCompare(
"verbose",option+1) == 0)
3223 if ((LocaleCompare(
"version",option+1) == 0) ||
3224 (LocaleCompare(
"-version",option+1) == 0))
3226 ListMagickVersion(stdout);
3229 if (LocaleCompare(
"vignette",option+1) == 0)
3234 if (i == (ssize_t) argc)
3235 ThrowConvertException(OptionError,
"MissingArgument",option);
3236 if (IsGeometry(argv[i]) == MagickFalse)
3237 ThrowConvertInvalidArgumentException(option,argv[i]);
3240 if (LocaleCompare(
"virtual-pixel",option+1) == 0)
3248 if (i == (ssize_t) argc)
3249 ThrowConvertException(OptionError,
"MissingArgument",option);
3250 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
3253 ThrowConvertException(OptionError,
3254 "UnrecognizedVirtualPixelMethod",argv[i]);
3257 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3261 if (LocaleCompare(
"wave",option+1) == 0)
3264 if (i == (ssize_t) argc)
3265 ThrowConvertException(OptionError,
"MissingArgument",option);
3266 if (IsGeometry(argv[i]) == MagickFalse)
3267 ThrowConvertInvalidArgumentException(option,argv[i]);
3270 if (LocaleCompare(
"wavelet-denoise",option+1) == 0)
3273 if (i == (ssize_t) argc)
3274 ThrowConvertException(OptionError,
"MissingArgument",option);
3275 if (IsGeometry(argv[i]) == MagickFalse)
3276 ThrowConvertInvalidArgumentException(option,argv[i]);
3279 if (LocaleCompare(
"weight",option+1) == 0)
3284 if (i == (ssize_t) argc)
3285 ThrowConvertException(OptionError,
"MissingArgument",option);
3288 if (LocaleCompare(
"white-point",option+1) == 0)
3293 if (i == (ssize_t) argc)
3294 ThrowConvertException(OptionError,
"MissingArgument",option);
3295 if (IsGeometry(argv[i]) == MagickFalse)
3296 ThrowConvertInvalidArgumentException(option,argv[i]);
3299 if (LocaleCompare(
"white-balance",option+1) == 0)
3301 if (LocaleCompare(
"white-threshold",option+1) == 0)
3306 if (i == (ssize_t) argc)
3307 ThrowConvertException(OptionError,
"MissingArgument",option);
3308 if (IsGeometry(argv[i]) == MagickFalse)
3309 ThrowConvertInvalidArgumentException(option,argv[i]);
3312 if (LocaleCompare(
"word-break",option+1) == 0)
3320 if (i == (ssize_t) argc)
3321 ThrowConvertException(OptionError,
"MissingArgument",option);
3322 word_break=ParseCommandOption(MagickWordBreakOptions,MagickFalse,
3325 ThrowConvertException(OptionError,
"UnrecognizedArgument",argv[i]);
3328 if (LocaleCompare(
"write",option+1) == 0)
3331 if (i == (ssize_t) argc)
3332 ThrowConvertException(OptionError,
"MissingArgument",option);
3335 if (LocaleCompare(
"write-mask",option+1) == 0)
3340 if (i == (ssize_t) argc)
3341 ThrowConvertException(OptionError,
"MissingArgument",option);
3344 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3349 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3351 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
3352 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
3353 if (fire != MagickFalse)
3354 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
3357 ThrowConvertException(OptionError,
"UnbalancedParenthesis",argv[i]);
3358 if (i-- != (ssize_t) (argc-1))
3359 ThrowConvertException(OptionError,
"MissingAnImageFilename",argv[argc-1]);
3360 FinalizeImageSettings(image_info,image,MagickTrue);
3361 if (image == (Image *) NULL)
3362 ThrowConvertException(OptionError,
"NoImagesDefined",argv[argc-1]);
3363 if (IsCommandOption(argv[argc-1]))
3364 ThrowConvertException(OptionError,
"MissingAnImageFilename",argv[argc-1]);
3365 if (LocaleCompare(
" ",argv[argc-1]) == 0)
3366 ThrowConvertException(OptionError,
"MissingAnImageFilename",argv[argc-1]);
3367 status&=(MagickStatusType) WriteImages(image_info,image,argv[argc-1],
3369 if (metadata != (
char **) NULL)
3374 text=InterpretImageProperties(image_info,image,format,exception);
3375 if (text == (
char *) NULL)
3376 ThrowConvertException(ResourceLimitError,
"MemoryAllocationFailed",
3377 GetExceptionMessage(errno));
3378 (void) ConcatenateString(&(*metadata),text);
3379 text=DestroyString(text);
3382 return(status != 0 ? MagickTrue : MagickFalse);