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"
54#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
90static MagickBooleanType ConcatenateImages(
int argc,
char **argv,
91 ExceptionInfo *exception)
109 output=fopen_utf8(argv[argc-1],
"wb");
110 if (output == (FILE *) NULL)
112 ThrowFileException(exception,FileOpenError,
"UnableToOpenFile",
117 for (i=2; i < (ssize_t) (argc-1); i++)
119 input=fopen_utf8(argv[i],
"rb");
120 if (input == (FILE *) NULL)
122 ThrowFileException(exception,FileOpenError,
"UnableToOpenFile",argv[i]);
125 for (c=fgetc(input); c != EOF; c=fgetc(input))
126 if (fputc((
char) c,output) != c)
128 (void) fclose(input);
129 (void) remove_utf8(argv[i]);
131 (void) fclose(output);
135static MagickBooleanType ConvertUsage(
void)
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",
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",
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"
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"
260 " -paint radius simulate an oil painting\n"
261 " -perceptible epsilon\n"
262 " pixel value less than |epsilon| become epsilon or\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"
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"
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",
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"
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",
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";
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);
481 "\nBy default, the image format of 'file' is determined by its magic\n");
483 "number. To specify a particular image format, precede the filename\n");
485 "with an image format name and a colon (i.e. ps:image) or specify the\n");
487 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
488 (void) printf(
"'-' for standard input or output.\n");
492WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
493 int argc,
char **argv,
char **metadata,ExceptionInfo *exception)
495#define NotInitialized (unsigned int) (~0)
496#define DestroyConvert() \
498 DestroyImageStack(); \
499 for (i=0; i < (ssize_t) argc; i++) \
500 argv[i]=DestroyString(argv[i]); \
501 argv=(char **) RelinquishMagickMemory(argv); \
503#define ThrowConvertException(asperity,tag,option) \
505 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
508 return(MagickFalse); \
510#define ThrowConvertInvalidArgumentException(option,argument) \
512 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
513 "InvalidArgument","'%s': %s",option,argument); \
515 return(MagickFalse); \
526 *image = (Image *) NULL;
529 image_stack[MaxImageStackDepth+1];
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");
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))
565 ListMagickVersion(stdout);
571 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
572 "MissingArgument",
"%s",
"");
573 (void) ConvertUsage();
576 filename=(
char *) NULL;
581 option=(
char *) NULL;
583 respect_parentheses=MagickFalse;
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++)
598 if (LocaleCompare(option,
"(") == 0)
600 FireImageStack(MagickTrue,MagickTrue,pend);
601 if (k == MaxImageStackDepth)
602 ThrowConvertException(OptionError,
"ParenthesisNestedTooDeeply",
607 if (LocaleCompare(option,
")") == 0)
609 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
611 ThrowConvertException(OptionError,
"UnableToParseExpression",option);
615 if (IsCommandOption(option) == MagickFalse)
623 FireImageStack(MagickTrue,MagickTrue,pend);
625 if ((LocaleCompare(filename,
"--") == 0) && (i < (ssize_t) (argc-1)))
627 if (image_info->ping != MagickFalse)
628 images=PingImages(image_info,filename,exception);
630 images=ReadImages(image_info,filename,exception);
631 status&=(MagickStatusType) (images != (Image *) NULL) &&
632 (exception->severity < ErrorException);
633 if (images == (Image *) NULL)
635 AppendImageStack(images);
638 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
643 if (LocaleCompare(
"adaptive-blur",option+1) == 0)
646 if (i == (ssize_t) argc)
647 ThrowConvertException(OptionError,
"MissingArgument",option);
648 if (IsGeometry(argv[i]) == MagickFalse)
649 ThrowConvertInvalidArgumentException(option,argv[i]);
652 if (LocaleCompare(
"adaptive-resize",option+1) == 0)
655 if (i == (ssize_t) argc)
656 ThrowConvertException(OptionError,
"MissingArgument",option);
657 if (IsGeometry(argv[i]) == MagickFalse)
658 ThrowConvertInvalidArgumentException(option,argv[i]);
661 if (LocaleCompare(
"adaptive-sharpen",option+1) == 0)
664 if (i == (ssize_t) argc)
665 ThrowConvertException(OptionError,
"MissingArgument",option);
666 if (IsGeometry(argv[i]) == MagickFalse)
667 ThrowConvertInvalidArgumentException(option,argv[i]);
670 if (LocaleCompare(
"adjoin",option+1) == 0)
672 if (LocaleCompare(
"affine",option+1) == 0)
677 if (i == (ssize_t) argc)
678 ThrowConvertException(OptionError,
"MissingArgument",option);
679 if (IsGeometry(argv[i]) == MagickFalse)
680 ThrowConvertInvalidArgumentException(option,argv[i]);
683 if (LocaleCompare(
"alpha",option+1) == 0)
691 if (i == (ssize_t) argc)
692 ThrowConvertException(OptionError,
"MissingArgument",option);
693 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
696 ThrowConvertException(OptionError,
697 "UnrecognizedAlphaChannelOption",argv[i]);
700 if (LocaleCompare(
"annotate",option+1) == 0)
705 if (i == (ssize_t) argc)
706 ThrowConvertException(OptionError,
"MissingArgument",option);
707 if (IsGeometry(argv[i]) == MagickFalse)
708 ThrowConvertInvalidArgumentException(option,argv[i]);
710 if (i == (ssize_t) argc)
711 ThrowConvertException(OptionError,
"MissingArgument",option);
714 if (LocaleCompare(
"antialias",option+1) == 0)
716 if (LocaleCompare(
"append",option+1) == 0)
718 if (LocaleCompare(
"attenuate",option+1) == 0)
723 if (i == (ssize_t) argc)
724 ThrowConvertException(OptionError,
"MissingArgument",option);
725 if (IsGeometry(argv[i]) == MagickFalse)
726 ThrowConvertInvalidArgumentException(option,argv[i]);
729 if (LocaleCompare(
"authenticate",option+1) == 0)
734 if (i == (ssize_t) argc)
735 ThrowConvertException(OptionError,
"MissingArgument",option);
738 if (LocaleCompare(
"auto-gamma",option+1) == 0)
740 if (LocaleCompare(
"auto-level",option+1) == 0)
742 if (LocaleCompare(
"auto-orient",option+1) == 0)
744 if (LocaleCompare(
"auto-threshold",option+1) == 0)
752 if (i == (ssize_t) argc)
753 ThrowConvertException(OptionError,
"MissingArgument",option);
754 method=ParseCommandOption(MagickAutoThresholdOptions,MagickFalse,
757 ThrowConvertException(OptionError,
"UnrecognizedThresholdMethod",
761 if (LocaleCompare(
"average",option+1) == 0)
763 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
767 if (LocaleCompare(
"background",option+1) == 0)
772 if (i == (ssize_t) argc)
773 ThrowConvertException(OptionError,
"MissingArgument",option);
776 if (LocaleCompare(
"bench",option+1) == 0)
781 if (i == (ssize_t) argc)
782 ThrowConvertException(OptionError,
"MissingArgument",option);
783 if (IsGeometry(argv[i]) == MagickFalse)
784 ThrowConvertInvalidArgumentException(option,argv[i]);
787 if (LocaleCompare(
"bias",option+1) == 0)
792 if (i == (ssize_t) argc)
793 ThrowConvertException(OptionError,
"MissingArgument",option);
794 if (IsGeometry(argv[i]) == MagickFalse)
795 ThrowConvertInvalidArgumentException(option,argv[i]);
798 if (LocaleCompare(
"bilateral-blur",option+1) == 0)
803 if (i == (ssize_t) argc)
804 ThrowConvertException(OptionError,
"MissingArgument",option);
805 if (IsGeometry(argv[i]) == MagickFalse)
806 ThrowConvertInvalidArgumentException(option,argv[i]);
809 if (LocaleCompare(
"black-point-compensation",option+1) == 0)
811 if (LocaleCompare(
"black-threshold",option+1) == 0)
816 if (i == (ssize_t) argc)
817 ThrowConvertException(OptionError,
"MissingArgument",option);
818 if (IsGeometry(argv[i]) == MagickFalse)
819 ThrowConvertInvalidArgumentException(option,argv[i]);
822 if (LocaleCompare(
"blue-primary",option+1) == 0)
827 if (i == (ssize_t) argc)
828 ThrowConvertException(OptionError,
"MissingArgument",option);
829 if (IsGeometry(argv[i]) == MagickFalse)
830 ThrowConvertInvalidArgumentException(option,argv[i]);
833 if (LocaleCompare(
"blue-shift",option+1) == 0)
838 if (i == (ssize_t) argc)
839 ThrowConvertException(OptionError,
"MissingArgument",option);
840 if (IsGeometry(argv[i]) == MagickFalse)
841 ThrowConvertInvalidArgumentException(option,argv[i]);
844 if (LocaleCompare(
"blur",option+1) == 0)
849 if (i == (ssize_t) argc)
850 ThrowConvertException(OptionError,
"MissingArgument",option);
851 if (IsGeometry(argv[i]) == MagickFalse)
852 ThrowConvertInvalidArgumentException(option,argv[i]);
855 if (LocaleCompare(
"border",option+1) == 0)
860 if (i == (ssize_t) argc)
861 ThrowConvertException(OptionError,
"MissingArgument",option);
862 if (IsGeometry(argv[i]) == MagickFalse)
863 ThrowConvertInvalidArgumentException(option,argv[i]);
866 if (LocaleCompare(
"bordercolor",option+1) == 0)
871 if (i == (ssize_t) argc)
872 ThrowConvertException(OptionError,
"MissingArgument",option);
875 if (LocaleCompare(
"box",option+1) == 0)
880 if (i == (ssize_t) argc)
881 ThrowConvertException(OptionError,
"MissingArgument",option);
884 if (LocaleCompare(
"brightness-contrast",option+1) == 0)
887 if (i == (ssize_t) argc)
888 ThrowConvertException(OptionError,
"MissingArgument",option);
889 if (IsGeometry(argv[i]) == MagickFalse)
890 ThrowConvertInvalidArgumentException(option,argv[i]);
893 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
897 if (LocaleCompare(
"cache",option+1) == 0)
902 if (i == (ssize_t) argc)
903 ThrowConvertException(OptionError,
"MissingArgument",option);
904 if (IsGeometry(argv[i]) == MagickFalse)
905 ThrowConvertInvalidArgumentException(option,argv[i]);
908 if (LocaleCompare(
"canny",option+1) == 0)
913 if (i == (ssize_t) argc)
914 ThrowConvertException(OptionError,
"MissingArgument",option);
915 if (IsGeometry(argv[i]) == MagickFalse)
916 ThrowConvertInvalidArgumentException(option,argv[i]);
919 if (LocaleCompare(
"caption",option+1) == 0)
924 if (i == (ssize_t) argc)
925 ThrowConvertException(OptionError,
"MissingArgument",option);
928 if (LocaleCompare(
"cdl",option+1) == 0)
933 if (i == (ssize_t) argc)
934 ThrowConvertException(OptionError,
"MissingArgument",option);
937 if (LocaleCompare(
"channel",option+1) == 0)
945 if (i == (ssize_t) argc)
946 ThrowConvertException(OptionError,
"MissingArgument",option);
947 channel=ParseChannelOption(argv[i]);
949 ThrowConvertException(OptionError,
"UnrecognizedChannelType",
953 if (LocaleCompare(
"channel-fx",option+1) == 0)
961 if (i == (ssize_t) argc)
962 ThrowConvertException(OptionError,
"MissingArgument",option);
963 channel=ParsePixelChannelOption(argv[i]);
965 ThrowConvertException(OptionError,
"UnrecognizedChannelType",
969 if (LocaleCompare(
"charcoal",option+1) == 0)
974 if (i == (ssize_t) argc)
975 ThrowConvertException(OptionError,
"MissingArgument",option);
976 if (IsGeometry(argv[i]) == MagickFalse)
977 ThrowConvertInvalidArgumentException(option,argv[i]);
980 if (LocaleCompare(
"chop",option+1) == 0)
985 if (i == (ssize_t) argc)
986 ThrowConvertException(OptionError,
"MissingArgument",option);
987 if (IsGeometry(argv[i]) == MagickFalse)
988 ThrowConvertInvalidArgumentException(option,argv[i]);
991 if (LocaleCompare(
"clahe",option+1) == 0)
996 if (i == (ssize_t) argc)
997 ThrowConvertException(OptionError,
"MissingArgument",option);
998 if (IsGeometry(argv[i]) == MagickFalse)
999 ThrowConvertInvalidArgumentException(option,argv[i]);
1002 if (LocaleCompare(
"clamp",option+1) == 0)
1004 if (LocaleCompare(
"clip",option+1) == 0)
1006 if (LocaleCompare(
"clip-mask",option+1) == 0)
1011 if (i == (ssize_t) argc)
1012 ThrowConvertException(OptionError,
"MissingArgument",option);
1015 if (LocaleCompare(
"clip-path",option+1) == 0)
1018 if (i == (ssize_t) argc)
1019 ThrowConvertException(OptionError,
"MissingArgument",option);
1022 if (LocaleCompare(
"clone",option+1) == 0)
1028 clone_list=CloneImageList(image,exception);
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);
1035 clone_images=CloneImages(clone_list,
"-1",exception);
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);
1045 if (clone_images == (Image *) NULL)
1046 ThrowConvertException(OptionError,
"NoSuchImage",option);
1047 AppendImageStack(clone_images);
1048 clone_list=DestroyImageList(clone_list);
1051 if (LocaleCompare(
"clut",option+1) == 0)
1053 if (LocaleCompare(
"coalesce",option+1) == 0)
1055 if (LocaleCompare(
"colorize",option+1) == 0)
1060 if (i == (ssize_t) argc)
1061 ThrowConvertException(OptionError,
"MissingArgument",option);
1062 if (IsGeometry(argv[i]) == MagickFalse)
1063 ThrowConvertInvalidArgumentException(option,argv[i]);
1066 if (LocaleCompare(
"color-matrix",option+1) == 0)
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);
1082 if (LocaleCompare(
"colors",option+1) == 0)
1087 if ((i == (ssize_t) argc) ||
1088 (IsGeometry(argv[i]) == MagickFalse))
1089 ThrowConvertException(OptionError,
"MissingArgument",option);
1092 if (LocaleCompare(
"colorspace",option+1) == 0)
1100 if (i == (ssize_t) argc)
1101 ThrowConvertException(OptionError,
"MissingArgument",option);
1102 colorspace=ParseCommandOption(MagickColorspaceOptions,
1103 MagickFalse,argv[i]);
1105 ThrowConvertException(OptionError,
"UnrecognizedColorspace",
1109 if (LocaleCompare(
"color-threshold",option+1) == 0)
1114 if (i == (ssize_t) argc)
1115 ThrowConvertException(OptionError,
"MissingArgument",option);
1118 if (LocaleCompare(
"combine",option+1) == 0)
1120 if (LocaleCompare(
"comment",option+1) == 0)
1125 if (i == (ssize_t) argc)
1126 ThrowConvertException(OptionError,
"MissingArgument",option);
1129 if (LocaleCompare(
"compare",option+1) == 0)
1131 if (LocaleCompare(
"complex",option+1) == 0)
1139 if (i == (ssize_t) argc)
1140 ThrowConvertException(OptionError,
"MissingArgument",option);
1141 op=ParseCommandOption(MagickComplexOptions,MagickFalse,argv[i]);
1143 ThrowConvertException(OptionError,
"UnrecognizedComplexOperator",
1147 if (LocaleCompare(
"compose",option+1) == 0)
1155 if (i == (ssize_t) argc)
1156 ThrowConvertException(OptionError,
"MissingArgument",option);
1157 compose=ParseCommandOption(MagickComposeOptions,MagickFalse,
1160 ThrowConvertException(OptionError,
"UnrecognizedComposeOperator",
1164 if (LocaleCompare(
"composite",option+1) == 0)
1166 if (LocaleCompare(
"compress",option+1) == 0)
1174 if (i == (ssize_t) argc)
1175 ThrowConvertException(OptionError,
"MissingArgument",option);
1176 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
1179 ThrowConvertException(OptionError,
"UnrecognizedImageCompression",
1183 if (LocaleCompare(
"concurrent",option+1) == 0)
1185 if (LocaleCompare(
"connected-components",option+1) == 0)
1188 if (i == (ssize_t) argc)
1189 ThrowConvertException(OptionError,
"MissingArgument",option);
1190 if (IsGeometry(argv[i]) == MagickFalse)
1191 ThrowConvertInvalidArgumentException(option,argv[i]);
1194 if (LocaleCompare(
"contrast",option+1) == 0)
1196 if (LocaleCompare(
"contrast-stretch",option+1) == 0)
1199 if (i == (ssize_t) argc)
1200 ThrowConvertException(OptionError,
"MissingArgument",option);
1201 if (IsGeometry(argv[i]) == MagickFalse)
1202 ThrowConvertInvalidArgumentException(option,argv[i]);
1205 if (LocaleCompare(
"convolve",option+1) == 0)
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);
1221 if (LocaleCompare(
"copy",option+1) == 0)
1226 if (i == (ssize_t) argc)
1227 ThrowConvertException(OptionError,
"MissingArgument",option);
1228 if (IsGeometry(argv[i]) == MagickFalse)
1229 ThrowConvertInvalidArgumentException(option,argv[i]);
1231 if (i == (ssize_t) argc)
1232 ThrowConvertException(OptionError,
"MissingArgument",option);
1233 if (IsGeometry(argv[i]) == MagickFalse)
1234 ThrowConvertInvalidArgumentException(option,argv[i]);
1237 if (LocaleCompare(
"crop",option+1) == 0)
1242 if (i == (ssize_t) argc)
1243 ThrowConvertException(OptionError,
"MissingArgument",option);
1244 if (IsGeometry(argv[i]) == MagickFalse)
1245 ThrowConvertInvalidArgumentException(option,argv[i]);
1248 if (LocaleCompare(
"cycle",option+1) == 0)
1253 if (i == (ssize_t) argc)
1254 ThrowConvertException(OptionError,
"MissingArgument",option);
1255 if (IsGeometry(argv[i]) == MagickFalse)
1256 ThrowConvertInvalidArgumentException(option,argv[i]);
1259 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1263 if (LocaleCompare(
"decipher",option+1) == 0)
1268 if (i == (ssize_t) argc)
1269 ThrowConvertException(OptionError,
"MissingArgument",option);
1272 if (LocaleCompare(
"deconstruct",option+1) == 0)
1274 if (LocaleCompare(
"debug",option+1) == 0)
1282 if (i == (ssize_t) argc)
1283 ThrowConvertException(OptionError,
"MissingArgument",option);
1284 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
1286 ThrowConvertException(OptionError,
"UnrecognizedEventType",
1288 (void) SetLogEventMask(argv[i]);
1291 if (LocaleCompare(
"define",option+1) == 0)
1294 if (i == (ssize_t) argc)
1295 ThrowConvertException(OptionError,
"MissingArgument",option);
1301 define=GetImageOption(image_info,argv[i]);
1302 if (define == (
const char *) NULL)
1303 ThrowConvertException(OptionError,
"NoSuchOption",argv[i]);
1308 if (LocaleCompare(
"delay",option+1) == 0)
1313 if (i == (ssize_t) argc)
1314 ThrowConvertException(OptionError,
"MissingArgument",option);
1315 if (IsGeometry(argv[i]) == MagickFalse)
1316 ThrowConvertInvalidArgumentException(option,argv[i]);
1319 if (LocaleCompare(
"density",option+1) == 0)
1324 if (i == (ssize_t) argc)
1325 ThrowConvertException(OptionError,
"MissingArgument",option);
1326 if (IsGeometry(argv[i]) == MagickFalse)
1327 ThrowConvertInvalidArgumentException(option,argv[i]);
1330 if (LocaleCompare(
"depth",option+1) == 0)
1335 if (i == (ssize_t) argc)
1336 ThrowConvertException(OptionError,
"MissingArgument",option);
1337 if (IsGeometry(argv[i]) == MagickFalse)
1338 ThrowConvertInvalidArgumentException(option,argv[i]);
1341 if (LocaleCompare(
"delete",option+1) == 0)
1346 if (i == (ssize_t) argc)
1347 ThrowConvertException(OptionError,
"MissingArgument",option);
1348 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1349 ThrowConvertInvalidArgumentException(option,argv[i]);
1352 if (LocaleCompare(
"deskew",option+1) == 0)
1357 if (i == (ssize_t) argc)
1358 ThrowConvertException(OptionError,
"MissingArgument",option);
1359 if (IsGeometry(argv[i]) == MagickFalse)
1360 ThrowConvertInvalidArgumentException(option,argv[i]);
1363 if (LocaleCompare(
"despeckle",option+1) == 0)
1365 if (LocaleCompare(
"direction",option+1) == 0)
1373 if (i == (ssize_t) argc)
1374 ThrowConvertException(OptionError,
"MissingArgument",option);
1375 direction=ParseCommandOption(MagickDirectionOptions,MagickFalse,
1378 ThrowConvertException(OptionError,
"UnrecognizedDirectionType",
1382 if (LocaleCompare(
"display",option+1) == 0)
1387 if (i == (ssize_t) argc)
1388 ThrowConvertException(OptionError,
"MissingArgument",option);
1391 if (LocaleCompare(
"dispose",option+1) == 0)
1399 if (i == (ssize_t) argc)
1400 ThrowConvertException(OptionError,
"MissingArgument",option);
1401 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1403 ThrowConvertException(OptionError,
"UnrecognizedDisposeMethod",
1407 if (LocaleCompare(
"distort",option+1) == 0)
1413 if (i == (ssize_t) argc)
1414 ThrowConvertException(OptionError,
"MissingArgument",option);
1415 op=ParseCommandOption(MagickDistortOptions,MagickFalse,argv[i]);
1417 ThrowConvertException(OptionError,
"UnrecognizedDistortMethod",
1420 if (i == (ssize_t) argc)
1421 ThrowConvertException(OptionError,
"MissingArgument",option);
1424 if (LocaleCompare(
"dither",option+1) == 0)
1432 if (i == (ssize_t) argc)
1433 ThrowConvertException(OptionError,
"MissingArgument",option);
1434 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1436 ThrowConvertException(OptionError,
"UnrecognizedDitherMethod",
1440 if (LocaleCompare(
"draw",option+1) == 0)
1445 if (i == (ssize_t) argc)
1446 ThrowConvertException(OptionError,
"MissingArgument",option);
1449 if (LocaleCompare(
"duplicate",option+1) == 0)
1454 if (i == (ssize_t) argc)
1455 ThrowConvertException(OptionError,
"MissingArgument",option);
1456 if (IsGeometry(argv[i]) == MagickFalse)
1457 ThrowConvertInvalidArgumentException(option,argv[i]);
1460 if (LocaleCompare(
"duration",option+1) == 0)
1465 if (i == (ssize_t) argc)
1466 ThrowConvertException(OptionError,
"MissingArgument",option);
1467 if (IsGeometry(argv[i]) == MagickFalse)
1468 ThrowConvertInvalidArgumentException(option,argv[i]);
1471 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1475 if (LocaleCompare(
"edge",option+1) == 0)
1480 if (i == (ssize_t) argc)
1481 ThrowConvertException(OptionError,
"MissingArgument",option);
1482 if (IsGeometry(argv[i]) == MagickFalse)
1483 ThrowConvertInvalidArgumentException(option,argv[i]);
1486 if (LocaleCompare(
"emboss",option+1) == 0)
1491 if (i == (ssize_t) argc)
1492 ThrowConvertException(OptionError,
"MissingArgument",option);
1493 if (IsGeometry(argv[i]) == MagickFalse)
1494 ThrowConvertInvalidArgumentException(option,argv[i]);
1497 if (LocaleCompare(
"encipher",option+1) == 0)
1502 if (i == (ssize_t) argc)
1503 ThrowConvertException(OptionError,
"MissingArgument",option);
1506 if (LocaleCompare(
"encoding",option+1) == 0)
1511 if (i == (ssize_t) argc)
1512 ThrowConvertException(OptionError,
"MissingArgument",option);
1515 if (LocaleCompare(
"endian",option+1) == 0)
1523 if (i == (ssize_t) argc)
1524 ThrowConvertException(OptionError,
"MissingArgument",option);
1525 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1528 ThrowConvertException(OptionError,
"UnrecognizedEndianType",
1532 if (LocaleCompare(
"enhance",option+1) == 0)
1534 if (LocaleCompare(
"equalize",option+1) == 0)
1536 if (LocaleCompare(
"evaluate",option+1) == 0)
1544 if (i == (ssize_t) argc)
1545 ThrowConvertException(OptionError,
"MissingArgument",option);
1546 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1548 ThrowConvertException(OptionError,
"UnrecognizedEvaluateOperator",
1551 if (i == (ssize_t) argc)
1552 ThrowConvertException(OptionError,
"MissingArgument",option);
1553 if (IsGeometry(argv[i]) == MagickFalse)
1554 ThrowConvertInvalidArgumentException(option,argv[i]);
1557 if (LocaleCompare(
"evaluate-sequence",option+1) == 0)
1565 if (i == (ssize_t) argc)
1566 ThrowConvertException(OptionError,
"MissingArgument",option);
1567 op=ParseCommandOption(MagickEvaluateOptions,MagickFalse,argv[i]);
1569 ThrowConvertException(OptionError,
"UnrecognizedEvaluateOperator",
1573 if (LocaleCompare(
"extent",option+1) == 0)
1578 if (i == (ssize_t) argc)
1579 ThrowConvertException(OptionError,
"MissingArgument",option);
1580 if (IsGeometry(argv[i]) == MagickFalse)
1581 ThrowConvertInvalidArgumentException(option,argv[i]);
1584 if (LocaleCompare(
"extract",option+1) == 0)
1589 if (i == (ssize_t) argc)
1590 ThrowConvertException(OptionError,
"MissingArgument",option);
1591 if (IsGeometry(argv[i]) == MagickFalse)
1592 ThrowConvertInvalidArgumentException(option,argv[i]);
1595 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1599 if (LocaleCompare(
"family",option+1) == 0)
1604 if (i == (ssize_t) argc)
1605 ThrowConvertException(OptionError,
"MissingArgument",option);
1608 if (LocaleCompare(
"features",option+1) == 0)
1613 if (i == (ssize_t) argc)
1614 ThrowConvertException(OptionError,
"MissingArgument",option);
1615 if (IsGeometry(argv[i]) == MagickFalse)
1616 ThrowConvertInvalidArgumentException(option,argv[i]);
1619 if (LocaleCompare(
"fft",option+1) == 0)
1621 if (LocaleCompare(
"fill",option+1) == 0)
1626 if (i == (ssize_t) argc)
1627 ThrowConvertException(OptionError,
"MissingArgument",option);
1630 if (LocaleCompare(
"filter",option+1) == 0)
1638 if (i == (ssize_t) argc)
1639 ThrowConvertException(OptionError,
"MissingArgument",option);
1640 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1642 ThrowConvertException(OptionError,
"UnrecognizedImageFilter",
1646 if (LocaleCompare(
"flatten",option+1) == 0)
1648 if (LocaleCompare(
"flip",option+1) == 0)
1650 if (LocaleCompare(
"flop",option+1) == 0)
1652 if (LocaleCompare(
"floodfill",option+1) == 0)
1657 if (i == (ssize_t) argc)
1658 ThrowConvertException(OptionError,
"MissingArgument",option);
1659 if (IsGeometry(argv[i]) == MagickFalse)
1660 ThrowConvertInvalidArgumentException(option,argv[i]);
1662 if (i == (ssize_t) argc)
1663 ThrowConvertException(OptionError,
"MissingArgument",option);
1666 if (LocaleCompare(
"font",option+1) == 0)
1671 if (i == (ssize_t) argc)
1672 ThrowConvertException(OptionError,
"MissingArgument",option);
1675 if (LocaleCompare(
"format",option+1) == 0)
1680 if (i == (ssize_t) argc)
1681 ThrowConvertException(OptionError,
"MissingArgument",option);
1685 if (LocaleCompare(
"frame",option+1) == 0)
1690 if (i == (ssize_t) argc)
1691 ThrowConvertException(OptionError,
"MissingArgument",option);
1692 if (IsGeometry(argv[i]) == MagickFalse)
1693 ThrowConvertInvalidArgumentException(option,argv[i]);
1696 if (LocaleCompare(
"function",option+1) == 0)
1704 if (i == (ssize_t) argc)
1705 ThrowConvertException(OptionError,
"MissingArgument",option);
1706 op=ParseCommandOption(MagickFunctionOptions,MagickFalse,argv[i]);
1708 ThrowConvertException(OptionError,
"UnrecognizedFunction",argv[i]);
1710 if (i == (ssize_t) argc)
1711 ThrowConvertException(OptionError,
"MissingArgument",option);
1714 if (LocaleCompare(
"fuzz",option+1) == 0)
1719 if (i == (ssize_t) argc)
1720 ThrowConvertException(OptionError,
"MissingArgument",option);
1721 if (IsGeometry(argv[i]) == MagickFalse)
1722 ThrowConvertInvalidArgumentException(option,argv[i]);
1725 if (LocaleCompare(
"fx",option+1) == 0)
1728 if (i == (ssize_t) argc)
1729 ThrowConvertException(OptionError,
"MissingArgument",option);
1732 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1736 if (LocaleCompare(
"gamma",option+1) == 0)
1739 if (i == (ssize_t) argc)
1740 ThrowConvertException(OptionError,
"MissingArgument",option);
1741 if (IsGeometry(argv[i]) == MagickFalse)
1742 ThrowConvertInvalidArgumentException(option,argv[i]);
1745 if ((LocaleCompare(
"gaussian-blur",option+1) == 0) ||
1746 (LocaleCompare(
"gaussian",option+1) == 0))
1749 if (i == (ssize_t) argc)
1750 ThrowConvertException(OptionError,
"MissingArgument",option);
1751 if (IsGeometry(argv[i]) == MagickFalse)
1752 ThrowConvertInvalidArgumentException(option,argv[i]);
1755 if (LocaleCompare(
"geometry",option+1) == 0)
1760 if (i == (ssize_t) argc)
1761 ThrowConvertException(OptionError,
"MissingArgument",option);
1762 if (IsGeometry(argv[i]) == MagickFalse)
1763 ThrowConvertInvalidArgumentException(option,argv[i]);
1766 if (LocaleCompare(
"gravity",option+1) == 0)
1774 if (i == (ssize_t) argc)
1775 ThrowConvertException(OptionError,
"MissingArgument",option);
1776 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1779 ThrowConvertException(OptionError,
"UnrecognizedGravityType",
1783 if (LocaleCompare(
"grayscale",option+1) == 0)
1791 if (i == (ssize_t) argc)
1792 ThrowConvertException(OptionError,
"MissingArgument",option);
1793 method=ParseCommandOption(MagickPixelIntensityOptions,MagickFalse,
1796 ThrowConvertException(OptionError,
"UnrecognizedIntensityMethod",
1800 if (LocaleCompare(
"green-primary",option+1) == 0)
1805 if (i == (ssize_t) argc)
1806 ThrowConvertException(OptionError,
"MissingArgument",option);
1807 if (IsGeometry(argv[i]) == MagickFalse)
1808 ThrowConvertInvalidArgumentException(option,argv[i]);
1811 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1815 if (LocaleCompare(
"hald-clut",option+1) == 0)
1817 if ((LocaleCompare(
"help",option+1) == 0) ||
1818 (LocaleCompare(
"-help",option+1) == 0))
1821 return(ConvertUsage());
1823 if (LocaleCompare(
"hough-lines",option+1) == 0)
1828 if (i == (ssize_t) argc)
1829 ThrowConvertException(OptionError,
"MissingArgument",option);
1830 if (IsGeometry(argv[i]) == MagickFalse)
1831 ThrowConvertInvalidArgumentException(option,argv[i]);
1834 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1838 if (LocaleCompare(
"identify",option+1) == 0)
1840 if (LocaleCompare(
"ift",option+1) == 0)
1842 if (LocaleCompare(
"illuminant",option+1) == 0)
1850 if (i == (ssize_t) argc)
1851 ThrowConvertException(OptionError,
"MissingArgument",option);
1852 type=ParseCommandOption(MagickIlluminantOptions,MagickFalse,
1855 ThrowConvertException(OptionError,
"UnrecognizedIlluminantMethod",
1859 if (LocaleCompare(
"implode",option+1) == 0)
1864 if (i == (ssize_t) argc)
1865 ThrowConvertException(OptionError,
"MissingArgument",option);
1866 if (IsGeometry(argv[i]) == MagickFalse)
1867 ThrowConvertInvalidArgumentException(option,argv[i]);
1870 if (LocaleCompare(
"insert",option+1) == 0)
1875 if (i == (ssize_t) argc)
1876 ThrowConvertException(OptionError,
"MissingArgument",option);
1877 if (IsGeometry(argv[i]) == MagickFalse)
1878 ThrowConvertInvalidArgumentException(option,argv[i]);
1881 if (LocaleCompare(
"integral",option+1) == 0)
1883 if (LocaleCompare(
"intensity",option+1) == 0)
1891 if (i == (ssize_t) argc)
1892 ThrowConvertException(OptionError,
"MissingArgument",option);
1893 intensity=ParseCommandOption(MagickPixelIntensityOptions,
1894 MagickFalse,argv[i]);
1896 ThrowConvertException(OptionError,
"UnrecognizedIntensityMethod",
1900 if (LocaleCompare(
"intent",option+1) == 0)
1908 if (i == (ssize_t) argc)
1909 ThrowConvertException(OptionError,
"MissingArgument",option);
1910 intent=ParseCommandOption(MagickIntentOptions,MagickFalse,argv[i]);
1912 ThrowConvertException(OptionError,
"UnrecognizedIntentType",argv[i]);
1915 if (LocaleCompare(
"interlace",option+1) == 0)
1923 if (i == (ssize_t) argc)
1924 ThrowConvertException(OptionError,
"MissingArgument",option);
1925 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1928 ThrowConvertException(OptionError,
"UnrecognizedInterlaceType",
1932 if (LocaleCompare(
"interline-spacing",option+1) == 0)
1937 if (i == (ssize_t) argc)
1938 ThrowConvertException(OptionError,
"MissingArgument",option);
1939 if (IsGeometry(argv[i]) == MagickFalse)
1940 ThrowConvertInvalidArgumentException(option,argv[i]);
1943 if (LocaleCompare(
"interpolate",option+1) == 0)
1951 if (i == (ssize_t) argc)
1952 ThrowConvertException(OptionError,
"MissingArgument",option);
1953 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1955 if (interpolate < 0)
1956 ThrowConvertException(OptionError,
"UnrecognizedInterpolateMethod",
1960 if (LocaleCompare(
"interword-spacing",option+1) == 0)
1965 if (i == (ssize_t) argc)
1966 ThrowConvertException(OptionError,
"MissingArgument",option);
1967 if (IsGeometry(argv[i]) == MagickFalse)
1968 ThrowConvertInvalidArgumentException(option,argv[i]);
1971 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
1975 if (LocaleCompare(
"kerning",option+1) == 0)
1980 if (i == (ssize_t) argc)
1981 ThrowConvertException(OptionError,
"MissingArgument",option);
1982 if (IsGeometry(argv[i]) == MagickFalse)
1983 ThrowConvertInvalidArgumentException(option,argv[i]);
1986 if (LocaleCompare(
"kmeans",option+1) == 0)
1991 if (i == (ssize_t) argc)
1992 ThrowConvertException(OptionError,
"MissingArgument",option);
1993 if (IsGeometry(argv[i]) == MagickFalse)
1994 ThrowConvertInvalidArgumentException(option,argv[i]);
1997 if (LocaleCompare(
"kuwahara",option+1) == 0)
2002 if (i == (ssize_t) argc)
2003 ThrowConvertException(OptionError,
"MissingArgument",option);
2004 if (IsGeometry(argv[i]) == MagickFalse)
2005 ThrowConvertInvalidArgumentException(option,argv[i]);
2008 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2012 if (LocaleCompare(
"label",option+1) == 0)
2017 if (i == (ssize_t) argc)
2018 ThrowConvertException(OptionError,
"MissingArgument",option);
2021 if (LocaleCompare(
"lat",option+1) == 0)
2026 if (i == (ssize_t) argc)
2027 ThrowConvertException(OptionError,
"MissingArgument",option);
2028 if (IsGeometry(argv[i]) == MagickFalse)
2029 ThrowConvertInvalidArgumentException(option,argv[i]);
2032 if (LocaleCompare(
"layers",option+1) == 0)
2040 if (i == (ssize_t) argc)
2041 ThrowConvertException(OptionError,
"MissingArgument",option);
2042 type=ParseCommandOption(MagickLayerOptions,MagickFalse,argv[i]);
2044 ThrowConvertException(OptionError,
"UnrecognizedLayerMethod",
2048 if (LocaleCompare(
"level",option+1) == 0)
2051 if (i == (ssize_t) argc)
2052 ThrowConvertException(OptionError,
"MissingArgument",option);
2053 if (IsGeometry(argv[i]) == MagickFalse)
2054 ThrowConvertInvalidArgumentException(option,argv[i]);
2057 if (LocaleCompare(
"level-colors",option+1) == 0)
2060 if (i == (ssize_t) argc)
2061 ThrowConvertException(OptionError,
"MissingArgument",option);
2064 if (LocaleCompare(
"limit",option+1) == 0)
2078 if (i == (ssize_t) argc)
2079 ThrowConvertException(OptionError,
"MissingArgument",option);
2080 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
2083 ThrowConvertException(OptionError,
"UnrecognizedResourceType",
2086 if (i == (ssize_t) argc)
2087 ThrowConvertException(OptionError,
"MissingArgument",option);
2088 value=StringToDouble(argv[i],&p);
2090 if ((p == argv[i]) && (LocaleCompare(
"unlimited",argv[i]) != 0))
2091 ThrowConvertInvalidArgumentException(option,argv[i]);
2094 if (LocaleCompare(
"linear-stretch",option+1) == 0)
2097 if (i == (ssize_t) argc)
2098 ThrowConvertException(OptionError,
"MissingArgument",option);
2099 if (IsGeometry(argv[i]) == MagickFalse)
2100 ThrowConvertInvalidArgumentException(option,argv[i]);
2103 if (LocaleCompare(
"liquid-rescale",option+1) == 0)
2106 if (i == (ssize_t) argc)
2107 ThrowConvertException(OptionError,
"MissingArgument",option);
2108 if (IsGeometry(argv[i]) == MagickFalse)
2109 ThrowConvertInvalidArgumentException(option,argv[i]);
2112 if (LocaleCompare(
"list",option+1) == 0)
2120 if (i == (ssize_t) argc)
2121 ThrowConvertException(OptionError,
"MissingArgument",option);
2122 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
2124 ThrowConvertException(OptionError,
"UnrecognizedListType",argv[i]);
2125 status=MogrifyImageInfo(image_info,(
int) (i-j+1),(
const char **)
2128 return(status == 0 ? MagickFalse : MagickTrue);
2130 if (LocaleCompare(
"local-contrast",option+1) == 0)
2133 if (i == (ssize_t)argc)
2134 ThrowConvertException(OptionError,
"MissingArgument", option);
2135 if (IsGeometry(argv[i]) == MagickFalse)
2136 ThrowConvertInvalidArgumentException(option,argv[i]);
2139 if (LocaleCompare(
"log",option+1) == 0)
2144 if ((i == (ssize_t) argc) ||
2145 (strchr(argv[i],
'%') == (
char *) NULL))
2146 ThrowConvertException(OptionError,
"MissingArgument",option);
2149 if (LocaleCompare(
"loop",option+1) == 0)
2154 if (i == (ssize_t) argc)
2155 ThrowConvertException(OptionError,
"MissingArgument",option);
2156 if (IsGeometry(argv[i]) == MagickFalse)
2157 ThrowConvertInvalidArgumentException(option,argv[i]);
2160 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2164 if (LocaleCompare(
"magnify",option+1) == 0)
2166 if (LocaleCompare(
"map",option+1) == 0)
2171 if (i == (ssize_t) argc)
2172 ThrowConvertException(OptionError,
"MissingArgument",option);
2175 if (LocaleCompare(
"mask",option+1) == 0)
2180 if (i == (ssize_t) argc)
2181 ThrowConvertException(OptionError,
"MissingArgument",option);
2184 if (LocaleCompare(
"matte",option+1) == 0)
2186 if (LocaleCompare(
"mattecolor",option+1) == 0)
2191 if (i == (ssize_t)argc)
2192 ThrowConvertException(OptionError,
"MissingArgument", option);
2195 if (LocaleCompare(
"maximum",option+1) == 0)
2197 if (LocaleCompare(
"mean-shift",option+1) == 0)
2202 if (i == (ssize_t) argc)
2203 ThrowConvertException(OptionError,
"MissingArgument",option);
2204 if (IsGeometry(argv[i]) == MagickFalse)
2205 ThrowConvertInvalidArgumentException(option,argv[i]);
2208 if (LocaleCompare(
"median",option+1) == 0)
2213 if (i == (ssize_t) argc)
2214 ThrowConvertException(OptionError,
"MissingArgument",option);
2215 if (IsGeometry(argv[i]) == MagickFalse)
2216 ThrowConvertInvalidArgumentException(option,argv[i]);
2219 if (LocaleCompare(
"metric",option+1) == 0)
2227 if (i == (ssize_t) argc)
2228 ThrowConvertException(OptionError,
"MissingArgument",option);
2229 type=ParseCommandOption(MagickMetricOptions,MagickTrue,argv[i]);
2231 ThrowConvertException(OptionError,
"UnrecognizedMetricType",
2235 if (LocaleCompare(
"minimum",option+1) == 0)
2237 if (LocaleCompare(
"mode",option+1) == 0)
2242 if (i == (ssize_t) argc)
2243 ThrowConvertException(OptionError,
"MissingArgument",option);
2244 if (IsGeometry(argv[i]) == MagickFalse)
2245 ThrowConvertInvalidArgumentException(option,argv[i]);
2248 if (LocaleCompare(
"modulate",option+1) == 0)
2253 if (i == (ssize_t) argc)
2254 ThrowConvertException(OptionError,
"MissingArgument",option);
2255 if (IsGeometry(argv[i]) == MagickFalse)
2256 ThrowConvertInvalidArgumentException(option,argv[i]);
2259 if (LocaleCompare(
"moments",option+1) == 0)
2261 if (LocaleCompare(
"monitor",option+1) == 0)
2263 if (LocaleCompare(
"monochrome",option+1) == 0)
2265 if (LocaleCompare(
"morph",option+1) == 0)
2270 if (i == (ssize_t) argc)
2271 ThrowConvertException(OptionError,
"MissingArgument",option);
2272 if (IsGeometry(argv[i]) == MagickFalse)
2273 ThrowConvertInvalidArgumentException(option,argv[i]);
2276 if (LocaleCompare(
"morphology",option+1) == 0)
2279 token[MagickPathExtent];
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);
2293 ThrowConvertException(OptionError,
"UnrecognizedMorphologyMethod",
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);
2304 if (LocaleCompare(
"mosaic",option+1) == 0)
2306 if (LocaleCompare(
"motion-blur",option+1) == 0)
2311 if (i == (ssize_t) argc)
2312 ThrowConvertException(OptionError,
"MissingArgument",option);
2313 if (IsGeometry(argv[i]) == MagickFalse)
2314 ThrowConvertInvalidArgumentException(option,argv[i]);
2317 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2321 if (LocaleCompare(
"negate",option+1) == 0)
2323 if (LocaleCompare(
"noise",option+1) == 0)
2326 if (i == (ssize_t) argc)
2327 ThrowConvertException(OptionError,
"MissingArgument",option);
2333 noise=ParseCommandOption(MagickNoiseOptions,MagickFalse,
2336 ThrowConvertException(OptionError,
"UnrecognizedNoiseType",
2340 if (IsGeometry(argv[i]) == MagickFalse)
2341 ThrowConvertInvalidArgumentException(option,argv[i]);
2344 if (LocaleCompare(
"noop",option+1) == 0)
2346 if (LocaleCompare(
"normalize",option+1) == 0)
2348 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2352 if (LocaleCompare(
"opaque",option+1) == 0)
2355 if (i == (ssize_t) argc)
2356 ThrowConvertException(OptionError,
"MissingArgument",option);
2359 if (LocaleCompare(
"ordered-dither",option+1) == 0)
2364 if (i == (ssize_t) argc)
2365 ThrowConvertException(OptionError,
"MissingArgument",option);
2368 if (LocaleCompare(
"orient",option+1) == 0)
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",
2385 ThrowConvertException(OptionError,
"UnrecognizedOption",argv[i])
2389 if (LocaleCompare(
"page",option+1) == 0)
2394 if (i == (ssize_t) argc)
2395 ThrowConvertException(OptionError,
"MissingArgument",option);
2398 if (LocaleCompare(
"paint",option+1) == 0)
2403 if (i == (ssize_t) argc)
2404 ThrowConvertException(OptionError,
"MissingArgument",option);
2405 if (IsGeometry(argv[i]) == MagickFalse)
2406 ThrowConvertInvalidArgumentException(option,argv[i]);
2409 if (LocaleCompare(
"perceptible",option+1) == 0)
2414 if (i == (ssize_t) argc)
2415 ThrowConvertException(OptionError,
"MissingArgument",option);
2416 if (IsGeometry(argv[i]) == MagickFalse)
2417 ThrowConvertInvalidArgumentException(option,argv[i]);
2420 if (LocaleCompare(
"ping",option+1) == 0)
2422 if (LocaleCompare(
"pointsize",option+1) == 0)
2427 if (i == (ssize_t) argc)
2428 ThrowConvertException(OptionError,
"MissingArgument",option);
2429 if (IsGeometry(argv[i]) == MagickFalse)
2430 ThrowConvertInvalidArgumentException(option,argv[i]);
2433 if (LocaleCompare(
"polaroid",option+1) == 0)
2438 if (i == (ssize_t) argc)
2439 ThrowConvertException(OptionError,
"MissingArgument",option);
2440 if (IsGeometry(argv[i]) == MagickFalse)
2441 ThrowConvertInvalidArgumentException(option,argv[i]);
2444 if (LocaleCompare(
"poly",option+1) == 0)
2449 if (i == (ssize_t) argc)
2450 ThrowConvertException(OptionError,
"MissingArgument",option);
2451 if (IsGeometry(argv[i]) == MagickFalse)
2452 ThrowConvertInvalidArgumentException(option,argv[i]);
2455 if (LocaleCompare(
"posterize",option+1) == 0)
2460 if (i == (ssize_t) argc)
2461 ThrowConvertException(OptionError,
"MissingArgument",option);
2462 if (IsGeometry(argv[i]) == MagickFalse)
2463 ThrowConvertInvalidArgumentException(option,argv[i]);
2466 if (LocaleCompare(
"precision",option+1) == 0)
2471 if (i == (ssize_t) argc)
2472 ThrowConvertException(OptionError,
"MissingArgument",option);
2473 if (IsGeometry(argv[i]) == MagickFalse)
2474 ThrowConvertInvalidArgumentException(option,argv[i]);
2477 if (LocaleCompare(
"preview",option+1) == 0)
2485 if (i == (ssize_t) argc)
2486 ThrowConvertException(OptionError,
"MissingArgument",option);
2487 preview=ParseCommandOption(MagickPreviewOptions,MagickFalse,
2490 ThrowConvertException(OptionError,
"UnrecognizedPreviewType",
2494 if (LocaleCompare(
"print",option+1) == 0)
2499 if (i == (ssize_t) argc)
2500 ThrowConvertException(OptionError,
"MissingArgument",option);
2503 if (LocaleCompare(
"process",option+1) == 0)
2508 if (i == (ssize_t) argc)
2509 ThrowConvertException(OptionError,
"MissingArgument",option);
2512 if (LocaleCompare(
"profile",option+1) == 0)
2515 if (i == (ssize_t) argc)
2516 ThrowConvertException(OptionError,
"MissingArgument",option);
2519 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2523 if (LocaleCompare(
"quality",option+1) == 0)
2528 if (i == (ssize_t) argc)
2529 ThrowConvertException(OptionError,
"MissingArgument",option);
2530 if (IsGeometry(argv[i]) == MagickFalse)
2531 ThrowConvertInvalidArgumentException(option,argv[i]);
2534 if (LocaleCompare(
"quantize",option+1) == 0)
2542 if (i == (ssize_t) argc)
2543 ThrowConvertException(OptionError,
"MissingArgument",option);
2544 colorspace=ParseCommandOption(MagickColorspaceOptions,
2545 MagickFalse,argv[i]);
2547 ThrowConvertException(OptionError,
"UnrecognizedColorspace",
2551 if (LocaleCompare(
"quiet",option+1) == 0)
2553 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2557 if (LocaleCompare(
"rotational-blur",option+1) == 0)
2560 if (i == (ssize_t) argc)
2561 ThrowConvertException(OptionError,
"MissingArgument",option);
2562 if (IsGeometry(argv[i]) == MagickFalse)
2563 ThrowConvertInvalidArgumentException(option,argv[i]);
2566 if (LocaleCompare(
"raise",option+1) == 0)
2569 if (i == (ssize_t) argc)
2570 ThrowConvertException(OptionError,
"MissingArgument",option);
2571 if (IsGeometry(argv[i]) == MagickFalse)
2572 ThrowConvertInvalidArgumentException(option,argv[i]);
2575 if (LocaleCompare(
"random-threshold",option+1) == 0)
2580 if (i == (ssize_t) argc)
2581 ThrowConvertException(OptionError,
"MissingArgument",option);
2582 if (IsGeometry(argv[i]) == MagickFalse)
2583 ThrowConvertInvalidArgumentException(option,argv[i]);
2586 if (LocaleCompare(
"range-threshold",option+1) == 0)
2591 if (i == (ssize_t) argc)
2592 ThrowConvertException(OptionError,
"MissingArgument",option);
2593 if (IsGeometry(argv[i]) == MagickFalse)
2594 ThrowConvertInvalidArgumentException(option,argv[i]);
2597 if (LocaleCompare(
"read-mask",option+1) == 0)
2602 if (i == (ssize_t) argc)
2603 ThrowConvertException(OptionError,
"MissingArgument",option);
2606 if (LocaleCompare(
"red-primary",option+1) == 0)
2611 if (i == (ssize_t) argc)
2612 ThrowConvertException(OptionError,
"MissingArgument",option);
2613 if (IsGeometry(argv[i]) == MagickFalse)
2614 ThrowConvertInvalidArgumentException(option,argv[i]);
2617 if (LocaleCompare(
"regard-warnings",option+1) == 0)
2619 if (LocaleCompare(
"region",option+1) == 0)
2624 if (i == (ssize_t) argc)
2625 ThrowConvertException(OptionError,
"MissingArgument",option);
2626 if (IsGeometry(argv[i]) == MagickFalse)
2627 ThrowConvertInvalidArgumentException(option,argv[i]);
2630 if (LocaleCompare(
"remap",option+1) == 0)
2635 if (i == (ssize_t) argc)
2636 ThrowConvertException(OptionError,
"MissingArgument",option);
2639 if (LocaleCompare(
"render",option+1) == 0)
2641 if (LocaleCompare(
"repage",option+1) == 0)
2646 if (i == (ssize_t) argc)
2647 ThrowConvertException(OptionError,
"MissingArgument",option);
2648 if (IsGeometry(argv[i]) == MagickFalse)
2649 ThrowConvertInvalidArgumentException(option,argv[i]);
2652 if (LocaleCompare(
"resample",option+1) == 0)
2657 if (i == (ssize_t) argc)
2658 ThrowConvertException(OptionError,
"MissingArgument",option);
2659 if (IsGeometry(argv[i]) == MagickFalse)
2660 ThrowConvertInvalidArgumentException(option,argv[i]);
2663 if (LocaleCompare(
"reshape",option+1) == 0)
2668 if (i == (ssize_t) argc)
2669 ThrowConvertException(OptionError,
"MissingArgument",option);
2670 if (IsGeometry(argv[i]) == MagickFalse)
2671 ThrowConvertInvalidArgumentException(option,argv[i]);
2674 if (LocaleCompare(
"resize",option+1) == 0)
2679 if (i == (ssize_t) argc)
2680 ThrowConvertException(OptionError,
"MissingArgument",option);
2681 if (IsGeometry(argv[i]) == MagickFalse)
2682 ThrowConvertInvalidArgumentException(option,argv[i]);
2685 if (LocaleNCompare(
"respect-parentheses",option+1,17) == 0)
2687 respect_parentheses=(*option ==
'-') ? MagickTrue : MagickFalse;
2690 if (LocaleCompare(
"reverse",option+1) == 0)
2692 if (LocaleCompare(
"roll",option+1) == 0)
2697 if (i == (ssize_t) argc)
2698 ThrowConvertException(OptionError,
"MissingArgument",option);
2699 if (IsGeometry(argv[i]) == MagickFalse)
2700 ThrowConvertInvalidArgumentException(option,argv[i]);
2703 if (LocaleCompare(
"rotate",option+1) == 0)
2706 if (i == (ssize_t) argc)
2707 ThrowConvertException(OptionError,
"MissingArgument",option);
2708 if (IsGeometry(argv[i]) == MagickFalse)
2709 ThrowConvertInvalidArgumentException(option,argv[i]);
2712 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
2716 if (LocaleCompare(
"sample",option+1) == 0)
2721 if (i == (ssize_t) argc)
2722 ThrowConvertException(OptionError,
"MissingArgument",option);
2723 if (IsGeometry(argv[i]) == MagickFalse)
2724 ThrowConvertInvalidArgumentException(option,argv[i]);
2727 if (LocaleCompare(
"sampling-factor",option+1) == 0)
2732 if (i == (ssize_t) argc)
2733 ThrowConvertException(OptionError,
"MissingArgument",option);
2734 if (IsGeometry(argv[i]) == MagickFalse)
2735 ThrowConvertInvalidArgumentException(option,argv[i]);
2738 if (LocaleCompare(
"scale",option+1) == 0)
2743 if (i == (ssize_t) argc)
2744 ThrowConvertException(OptionError,
"MissingArgument",option);
2745 if (IsGeometry(argv[i]) == MagickFalse)
2746 ThrowConvertInvalidArgumentException(option,argv[i]);
2749 if (LocaleCompare(
"scene",option+1) == 0)
2754 if (i == (ssize_t) argc)
2755 ThrowConvertException(OptionError,
"MissingArgument",option);
2756 if (IsGeometry(argv[i]) == MagickFalse)
2757 ThrowConvertInvalidArgumentException(option,argv[i]);
2760 if (LocaleCompare(
"seed",option+1) == 0)
2765 if (i == (ssize_t) argc)
2766 ThrowConvertException(OptionError,
"MissingArgument",option);
2767 if (IsGeometry(argv[i]) == MagickFalse)
2768 ThrowConvertInvalidArgumentException(option,argv[i]);
2771 if (LocaleCompare(
"segment",option+1) == 0)
2776 if (i == (ssize_t) argc)
2777 ThrowConvertException(OptionError,
"MissingArgument",option);
2778 if (IsGeometry(argv[i]) == MagickFalse)
2779 ThrowConvertInvalidArgumentException(option,argv[i]);
2782 if (LocaleCompare(
"selective-blur",option+1) == 0)
2785 if (i == (ssize_t) argc)
2786 ThrowConvertException(OptionError,
"MissingArgument",option);
2787 if (IsGeometry(argv[i]) == MagickFalse)
2788 ThrowConvertInvalidArgumentException(option,argv[i]);
2791 if (LocaleCompare(
"separate",option+1) == 0)
2793 if (LocaleCompare(
"sepia-tone",option+1) == 0)
2798 if (i == (ssize_t) argc)
2799 ThrowConvertException(OptionError,
"MissingArgument",option);
2800 if (IsGeometry(argv[i]) == MagickFalse)
2801 ThrowConvertInvalidArgumentException(option,argv[i]);
2804 if (LocaleCompare(
"set",option+1) == 0)
2807 if (i == (ssize_t) argc)
2808 ThrowConvertException(OptionError,
"MissingArgument",option);
2812 if (i == (ssize_t) argc)
2813 ThrowConvertException(OptionError,
"MissingArgument",option);
2816 if (LocaleCompare(
"shade",option+1) == 0)
2819 if (i == (ssize_t) argc)
2820 ThrowConvertException(OptionError,
"MissingArgument",option);
2821 if (IsGeometry(argv[i]) == MagickFalse)
2822 ThrowConvertInvalidArgumentException(option,argv[i]);
2825 if (LocaleCompare(
"shadow",option+1) == 0)
2830 if (i == (ssize_t) argc)
2831 ThrowConvertException(OptionError,
"MissingArgument",option);
2832 if (IsGeometry(argv[i]) == MagickFalse)
2833 ThrowConvertInvalidArgumentException(option,argv[i]);
2836 if (LocaleCompare(
"sharpen",option+1) == 0)
2839 if (i == (ssize_t) argc)
2840 ThrowConvertException(OptionError,
"MissingArgument",option);
2841 if (IsGeometry(argv[i]) == MagickFalse)
2842 ThrowConvertInvalidArgumentException(option,argv[i]);
2845 if (LocaleCompare(
"shave",option+1) == 0)
2850 if (i == (ssize_t) argc)
2851 ThrowConvertException(OptionError,
"MissingArgument",option);
2852 if (IsGeometry(argv[i]) == MagickFalse)
2853 ThrowConvertInvalidArgumentException(option,argv[i]);
2856 if (LocaleCompare(
"shear",option+1) == 0)
2859 if (i == (ssize_t) argc)
2860 ThrowConvertException(OptionError,
"MissingArgument",option);
2861 if (IsGeometry(argv[i]) == MagickFalse)
2862 ThrowConvertInvalidArgumentException(option,argv[i]);
2865 if (LocaleCompare(
"sigmoidal-contrast",option+1) == 0)
2868 if (i == (ssize_t) argc)
2869 ThrowConvertException(OptionError,
"MissingArgument",option);
2870 if (IsGeometry(argv[i]) == MagickFalse)
2871 ThrowConvertInvalidArgumentException(option,argv[i]);
2874 if (LocaleCompare(
"size",option+1) == 0)
2879 if (i == (ssize_t) argc)
2880 ThrowConvertException(OptionError,
"MissingArgument",option);
2881 if (IsGeometry(argv[i]) == MagickFalse)
2882 ThrowConvertInvalidArgumentException(option,argv[i]);
2885 if (LocaleCompare(
"sketch",option+1) == 0)
2890 if (i == (ssize_t) argc)
2891 ThrowConvertException(OptionError,
"MissingArgument",option);
2892 if (IsGeometry(argv[i]) == MagickFalse)
2893 ThrowConvertInvalidArgumentException(option,argv[i]);
2896 if (LocaleCompare(
"smush",option+1) == 0)
2899 if (i == (ssize_t) argc)
2900 ThrowConvertException(OptionError,
"MissingArgument",option);
2901 if (IsGeometry(argv[i]) == MagickFalse)
2902 ThrowConvertInvalidArgumentException(option,argv[i]);
2905 if (LocaleCompare(
"solarize",option+1) == 0)
2910 if (i == (ssize_t) argc)
2911 ThrowConvertException(OptionError,
"MissingArgument",option);
2912 if (IsGeometry(argv[i]) == MagickFalse)
2913 ThrowConvertInvalidArgumentException(option,argv[i]);
2916 if (LocaleCompare(
"sort-pixels",option+1) == 0)
2918 if (LocaleCompare(
"sparse-color",option+1) == 0)
2924 if (i == (ssize_t) argc)
2925 ThrowConvertException(OptionError,
"MissingArgument",option);
2926 op=ParseCommandOption(MagickSparseColorOptions,MagickFalse,argv[i]);
2928 ThrowConvertException(OptionError,
"UnrecognizedSparseColorMethod",
2931 if (i == (ssize_t) argc)
2932 ThrowConvertException(OptionError,
"MissingArgument",option);
2935 if (LocaleCompare(
"splice",option+1) == 0)
2940 if (i == (ssize_t) argc)
2941 ThrowConvertException(OptionError,
"MissingArgument",option);
2942 if (IsGeometry(argv[i]) == MagickFalse)
2943 ThrowConvertInvalidArgumentException(option,argv[i]);
2946 if (LocaleCompare(
"spread",option+1) == 0)
2951 if ((i == (ssize_t) argc) ||
2952 (IsGeometry(argv[i]) == MagickFalse))
2953 ThrowConvertException(OptionError,
"MissingArgument",option);
2956 if (LocaleCompare(
"statistic",option+1) == 0)
2964 if (i == (ssize_t) argc)
2965 ThrowConvertException(OptionError,
"MissingArgument",option);
2966 op=ParseCommandOption(MagickStatisticOptions,MagickFalse,argv[i]);
2968 ThrowConvertException(OptionError,
"UnrecognizedStatisticType",
2971 if (i == (ssize_t) argc)
2972 ThrowConvertException(OptionError,
"MissingArgument",option);
2973 if (IsGeometry(argv[i]) == MagickFalse)
2974 ThrowConvertInvalidArgumentException(option,argv[i]);
2977 if (LocaleCompare(
"stretch",option+1) == 0)
2985 if (i == (ssize_t) argc)
2986 ThrowConvertException(OptionError,
"MissingArgument",option);
2987 stretch=ParseCommandOption(MagickStretchOptions,MagickFalse,
2990 ThrowConvertException(OptionError,
"UnrecognizedStyleType",
2994 if (LocaleCompare(
"strip",option+1) == 0)
2996 if (LocaleCompare(
"stroke",option+1) == 0)
3001 if (i == (ssize_t) argc)
3002 ThrowConvertException(OptionError,
"MissingArgument",option);
3005 if (LocaleCompare(
"strokewidth",option+1) == 0)
3010 if (i == (ssize_t) argc)
3011 ThrowConvertException(OptionError,
"MissingArgument",option);
3012 if (IsGeometry(argv[i]) == MagickFalse)
3013 ThrowConvertInvalidArgumentException(option,argv[i]);
3016 if (LocaleCompare(
"style",option+1) == 0)
3024 if (i == (ssize_t) argc)
3025 ThrowConvertException(OptionError,
"MissingArgument",option);
3026 style=ParseCommandOption(MagickStyleOptions,MagickFalse,argv[i]);
3028 ThrowConvertException(OptionError,
"UnrecognizedStyleType",
3032 if (LocaleCompare(
"support",option+1) == 0)
3037 if (LocaleCompare(
"swap",option+1) == 0)
3042 if (i == (ssize_t) argc)
3043 ThrowConvertException(OptionError,
"MissingArgument",option);
3044 if (IsGeometry(argv[i]) == MagickFalse)
3045 ThrowConvertInvalidArgumentException(option,argv[i]);
3048 if (LocaleCompare(
"swirl",option+1) == 0)
3053 if (i == (ssize_t) argc)
3054 ThrowConvertException(OptionError,
"MissingArgument",option);
3055 if (IsGeometry(argv[i]) == MagickFalse)
3056 ThrowConvertInvalidArgumentException(option,argv[i]);
3059 if (LocaleCompare(
"synchronize",option+1) == 0)
3061 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3065 if (LocaleCompare(
"taint",option+1) == 0)
3067 if (LocaleCompare(
"texture",option+1) == 0)
3072 if (i == (ssize_t) argc)
3073 ThrowConvertException(OptionError,
"MissingArgument",option);
3076 if (LocaleCompare(
"threshold",option+1) == 0)
3081 if (i == (ssize_t) argc)
3082 ThrowConvertException(OptionError,
"MissingArgument",option);
3083 if (IsGeometry(argv[i]) == MagickFalse)
3084 ThrowConvertInvalidArgumentException(option,argv[i]);
3087 if (LocaleCompare(
"thumbnail",option+1) == 0)
3092 if (i == (ssize_t) argc)
3093 ThrowConvertException(OptionError,
"MissingArgument",option);
3094 if (IsGeometry(argv[i]) == MagickFalse)
3095 ThrowConvertInvalidArgumentException(option,argv[i]);
3098 if (LocaleCompare(
"tile",option+1) == 0)
3103 if (i == (ssize_t) argc)
3104 ThrowConvertException(OptionError,
"MissingArgument",option);
3107 if (LocaleCompare(
"tile-offset",option+1) == 0)
3112 if (i == (ssize_t) argc)
3113 ThrowConvertException(OptionError,
"MissingArgument",option);
3114 if (IsGeometry(argv[i]) == MagickFalse)
3115 ThrowConvertInvalidArgumentException(option,argv[i]);
3118 if (LocaleCompare(
"tint",option+1) == 0)
3123 if (i == (ssize_t) argc)
3124 ThrowConvertException(OptionError,
"MissingArgument",option);
3125 if (IsGeometry(argv[i]) == MagickFalse)
3126 ThrowConvertInvalidArgumentException(option,argv[i]);
3129 if (LocaleCompare(
"transform",option+1) == 0)
3131 if (LocaleCompare(
"transparent",option+1) == 0)
3134 if (i == (ssize_t) argc)
3135 ThrowConvertException(OptionError,
"MissingArgument",option);
3138 if (LocaleCompare(
"transparent-color",option+1) == 0)
3143 if (i == (ssize_t) argc)
3144 ThrowConvertException(OptionError,
"MissingArgument",option);
3147 if (LocaleCompare(
"transpose",option+1) == 0)
3149 if (LocaleCompare(
"transverse",option+1) == 0)
3151 if (LocaleCompare(
"treedepth",option+1) == 0)
3156 if (i == (ssize_t) argc)
3157 ThrowConvertException(OptionError,
"MissingArgument",option);
3158 if (IsGeometry(argv[i]) == MagickFalse)
3159 ThrowConvertInvalidArgumentException(option,argv[i]);
3162 if (LocaleCompare(
"trim",option+1) == 0)
3164 if (LocaleCompare(
"type",option+1) == 0)
3172 if (i == (ssize_t) argc)
3173 ThrowConvertException(OptionError,
"MissingArgument",option);
3174 type=ParseCommandOption(MagickTypeOptions,MagickFalse,argv[i]);
3176 ThrowConvertException(OptionError,
"UnrecognizedImageType",
3180 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3184 if (LocaleCompare(
"undercolor",option+1) == 0)
3189 if (i == (ssize_t) argc)
3190 ThrowConvertException(OptionError,
"MissingArgument",option);
3193 if (LocaleCompare(
"unique-colors",option+1) == 0)
3195 if (LocaleCompare(
"units",option+1) == 0)
3203 if (i == (ssize_t) argc)
3204 ThrowConvertException(OptionError,
"MissingArgument",option);
3205 units=ParseCommandOption(MagickResolutionOptions,MagickFalse,
3208 ThrowConvertException(OptionError,
"UnrecognizedUnitsType",
3212 if (LocaleCompare(
"unsharp",option+1) == 0)
3217 if (i == (ssize_t) argc)
3218 ThrowConvertException(OptionError,
"MissingArgument",option);
3219 if (IsGeometry(argv[i]) == MagickFalse)
3220 ThrowConvertInvalidArgumentException(option,argv[i]);
3223 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3227 if (LocaleCompare(
"verbose",option+1) == 0)
3229 if ((LocaleCompare(
"version",option+1) == 0) ||
3230 (LocaleCompare(
"-version",option+1) == 0))
3232 ListMagickVersion(stdout);
3235 if (LocaleCompare(
"vignette",option+1) == 0)
3240 if (i == (ssize_t) argc)
3241 ThrowConvertException(OptionError,
"MissingArgument",option);
3242 if (IsGeometry(argv[i]) == MagickFalse)
3243 ThrowConvertInvalidArgumentException(option,argv[i]);
3246 if (LocaleCompare(
"virtual-pixel",option+1) == 0)
3254 if (i == (ssize_t) argc)
3255 ThrowConvertException(OptionError,
"MissingArgument",option);
3256 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
3259 ThrowConvertException(OptionError,
3260 "UnrecognizedVirtualPixelMethod",argv[i]);
3263 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3267 if (LocaleCompare(
"wave",option+1) == 0)
3270 if (i == (ssize_t) argc)
3271 ThrowConvertException(OptionError,
"MissingArgument",option);
3272 if (IsGeometry(argv[i]) == MagickFalse)
3273 ThrowConvertInvalidArgumentException(option,argv[i]);
3276 if (LocaleCompare(
"wavelet-denoise",option+1) == 0)
3279 if (i == (ssize_t) argc)
3280 ThrowConvertException(OptionError,
"MissingArgument",option);
3281 if (IsGeometry(argv[i]) == MagickFalse)
3282 ThrowConvertInvalidArgumentException(option,argv[i]);
3285 if (LocaleCompare(
"weight",option+1) == 0)
3290 if (i == (ssize_t) argc)
3291 ThrowConvertException(OptionError,
"MissingArgument",option);
3294 if (LocaleCompare(
"white-point",option+1) == 0)
3299 if (i == (ssize_t) argc)
3300 ThrowConvertException(OptionError,
"MissingArgument",option);
3301 if (IsGeometry(argv[i]) == MagickFalse)
3302 ThrowConvertInvalidArgumentException(option,argv[i]);
3305 if (LocaleCompare(
"white-balance",option+1) == 0)
3307 if (LocaleCompare(
"white-threshold",option+1) == 0)
3312 if (i == (ssize_t) argc)
3313 ThrowConvertException(OptionError,
"MissingArgument",option);
3314 if (IsGeometry(argv[i]) == MagickFalse)
3315 ThrowConvertInvalidArgumentException(option,argv[i]);
3318 if (LocaleCompare(
"word-break",option+1) == 0)
3326 if (i == (ssize_t) argc)
3327 ThrowConvertException(OptionError,
"MissingArgument",option);
3328 word_break=ParseCommandOption(MagickWordBreakOptions,MagickFalse,
3331 ThrowConvertException(OptionError,
"UnrecognizedArgument",argv[i]);
3334 if (LocaleCompare(
"write",option+1) == 0)
3337 if (i == (ssize_t) argc)
3338 ThrowConvertException(OptionError,
"MissingArgument",option);
3341 if (LocaleCompare(
"write-mask",option+1) == 0)
3346 if (i == (ssize_t) argc)
3347 ThrowConvertException(OptionError,
"MissingArgument",option);
3350 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3355 ThrowConvertException(OptionError,
"UnrecognizedOption",option)
3357 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
3358 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
3359 if (fire != MagickFalse)
3360 FireImageStack(MagickTrue,MagickTrue,MagickTrue);
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)
3372 ThrowConvertException(OptionError,
"MissingAnImageFilename",argv[argc-1]);
3373 status&=(MagickStatusType) WriteImages(image_info,image,argv[argc-1],
3375 if (metadata != (
char **) NULL)
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);
3388 return(status != 0 ? MagickTrue : MagickFalse);
3416WandExport MagickBooleanType MagickGetImageAlphaColor(
MagickWand *wand,
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);
3454WandExport MagickBooleanType MagickSetImageAlphaColor(
MagickWand *wand,
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);