13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% DDDD IIIII SSSSS PPPP L AAA Y Y % 73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% D D I SS P P L A A Y Y % 83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% D D I SSS PPPP L AAAAA Y % 93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% D D I SS P L A A Y % 103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% DDDD IIIII SSSSS P LLLLL A A Y % 113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Methods to Interactively Display and Edit an Image % 143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Software Design % 16de984cdc3631106b1cbbb8d3972b76a0fc27e8e8cristy% Cristy % 173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% July 1992 % 183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 207ce65e7125a4e1df1a274ce373c537a9df9c16cdCristy% Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization % 213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% dedicated to making software imaging solutions freely available. % 223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% You may not use this file except in compliance with the License. You may % 243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% obtain a copy of the License at % 253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% http://www.imagemagick.org/script/license.php % 273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Unless required by applicable law or agreed to in writing, software % 293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% distributed under the License is distributed on an "AS IS" BASIS, % 303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % 313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% See the License for the specific language governing permissions and % 323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% limitations under the License. % 333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% Use the display program to display an image or image sequence on any X 373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% server. 383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Include declarations. 433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 444c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/studio.h" 454c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/MagickWand.h" 464c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/mogrify-private.h" 474c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/display-private.h" 484c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/string-private.h" 493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/* 513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy+ D i s p l a y I m a g e C o m m a n d % 563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% % 593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% DisplayImageCommand() displays a sequence of images on any workstation 623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% display running an X server. Display first determines the hardware 633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% capabilities of the workstation. If the number of unique colors in an image 643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% is less than or equal to the number the workstation can support, the image 653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% is displayed in an X window. Otherwise the number of colors in the image is 663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% first reduced to match the color resolution of the workstation before it is 673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% displayed. 683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% This means that a continuous-tone 24 bits/pixel image can display on a 8 703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% bit pseudo-color device or monochrome device. In most instances the reduced 713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% color image closely resembles the original. Alternatively, a monochrome or 723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% pseudo-color image sequence can display on a continuous-tone 24 bits/pixels 733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% device. 743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% The format of the DisplayImageCommand method is: 763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% MagickBooleanType DisplayImageCommand(ImageInfo *image_info,int argc, 783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% char **argv,char **metadata,ExceptionInfo *exception) 793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% A description of each parameter follows: 813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o image_info: the image info. 833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o argc: the number of elements in the argument vector. 853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o argv: A text array containing the command line arguments. 873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o metadata: any metadata is returned here. 893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% o exception: return any errors or warnings in this structure. 913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy% 923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/ 933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 943ed852eea50f9d4cd633efb8c2b054b8e33c253cristystatic MagickBooleanType DisplayUsage(void) 953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ 963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy const char 973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy **p; 983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy static const char 1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *buttons[]= 1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "1 press to map or unmap the Command widget", 1033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "2 press and drag to magnify a region of an image", 1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "3 press to load an image from a visual image directory", 1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (char *) NULL 1063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy }, 1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *miscellaneous[]= 1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-debug events display copious debugging information", 1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-help print program options", 1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-list type print a list of supported option arguments", 1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-log format format of debugging information", 1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-version print version information", 1143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (char *) NULL 1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy }, 1163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *operators[]= 1173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-auto-orient automagically orient image", 1193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-border geometry surround image with a border of color", 120cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy "-clip clip along the first path from the 8BIM profile", 121cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy "-clip-path id clip along a named path from the 8BIM profile", 1223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-colors value preferred number of colors in the image", 1233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-contrast enhance or reduce the image contrast", 1243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-crop geometry preferred size and location of the cropped image", 1253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-decipher filename convert cipher pixels to plain pixels", 1263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-deskew threshold straighten an image", 1273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-despeckle reduce the speckles within an image", 1283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-edge factor apply a filter to detect edges in the image", 1293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-enhance apply a digital filter to enhance a noisy image", 1303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-equalize perform histogram equalization to an image", 1313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-extract geometry extract area from image", 1323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-flip flip image in the vertical direction", 1333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-flop flop image in the horizontal direction", 1343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-frame geometry surround image with an ornamental border", 1353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-fuzz distance colors within this distance are considered equal", 1363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-gamma value level of gamma correction", 1373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-monochrome transform image to black and white", 1383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-negate replace every pixel with its complementary color", 1393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-normalize transform image to span the full range of colors", 1403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-raise value lighten/darken image edges to create a 3-D effect", 1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-resample geometry change the resolution of an image", 1423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-resize geometry resize the image", 1433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-roll geometry roll an image vertically or horizontally", 1443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-rotate degrees apply Paeth rotation to the image", 1453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-sample geometry scale image with pixel sampling", 1463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-segment value segment an image", 1473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-sharpen geometry sharpen the image", 1483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-strip strip image of all profiles and comments", 1493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-threshold value threshold the image", 150e4cbe744d58ba0b08df933d7259a62250278f4accristy "-thumbnail geometry create a thumbnail of the image", 1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-trim trim image edges", 1523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (char *) NULL 1533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy }, 1543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *settings[]= 1553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-alpha option on, activate, off, deactivate, set, opaque, copy", 1573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " transparent, extract, background, or shape", 1583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-antialias remove pixel-aliasing", 1593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-authenticate password", 1603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " decipher image with this password", 1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-backdrop display image centered on a backdrop", 1623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-channel type apply option to select image channels", 1633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-colormap type Shared or Private", 1643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-colorspace type alternate image colorspace", 1653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-comment string annotate image with comment", 1663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-compress type type of pixel compression when writing the image", 1673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-define format:option", 1683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " define one or more image format options", 1693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-delay value display the next image after pausing", 1703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-density geometry horizontal and vertical density of the image", 1713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-depth value image depth", 1723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-display server display image to this X server", 1733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-dispose method layer disposal method", 1743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-dither method apply error diffusion to image", 1753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-endian type endianness (MSB or LSB) of the image", 1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-filter type use this filter when resizing an image", 1773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-format string output formatted image characteristics", 1783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-geometry geometry preferred size and location of the Image window", 1793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-gravity type horizontal and vertical backdrop placement", 1803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-identify identify the format and characteristics of the image", 1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-immutable displayed image cannot be modified", 1823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-interlace type type of image interlacing scheme", 1833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-interpolate method pixel color interpolation method", 1843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-label string assign a label to an image", 1853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-limit type value pixel cache resource limit", 1863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-loop iterations loop images then exit", 1873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-map type display image using this Standard Colormap", 188e9252c26b8f1dcf9d41023fb5918c2ce5e1f01c0cristy "-matte store matte channel if the image has one", 1893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-monitor monitor progress", 1903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-page geometry size and location of an image canvas", 1913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-profile filename add, delete, or apply an image profile", 1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-quality value JPEG/MIFF/PNG compression level", 1933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-quantize colorspace reduce colors in this colorspace", 1943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-quiet suppress all warning messages", 1953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-regard-warnings pay attention to warning messages", 1963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-remote command execute a command in an remote display process", 1973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-repage geometry size and location of an image canvas (operator)", 1983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-respect-parentheses settings remain in effect until parenthesis boundary", 1993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-sampling-factor geometry", 2003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " horizontal and vertical sampling factor", 201e9252c26b8f1dcf9d41023fb5918c2ce5e1f01c0cristy "-scenes range image scene range", 2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-seed value seed a new sequence of pseudo-random numbers", 2033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-set property value set an image property", 2043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-size geometry width and height of image", 205e9252c26b8f1dcf9d41023fb5918c2ce5e1f01c0cristy "-support factor resize support: > 1.0 is blurry, < 1.0 is sharp", 2063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-texture filename name of texture to tile onto the image background", 2073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-transparent-color color", 2083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " transparent color", 2093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-treedepth value color tree depth", 2103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-update seconds detect when image file is modified and redisplay", 2113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-verbose print detailed information about the image", 2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-visual type display image using this visual type", 2133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-virtual-pixel method", 2143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy " virtual pixel access method", 2153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-window id display image to background of this window", 2163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-window-group id exit program when this window id is destroyed", 2173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-write filename write image to a file", 2183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (char *) NULL 2193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy }, 2203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *sequence_operators[]= 2213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 2223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-coalesce merge a sequence of images", 2233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "-flatten flatten a sequence of images", 2243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (char *) NULL 2253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy }; 2263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 2274f7a61361f38ef4d3eaae0c74b9964a57aee813acristy ListMagickVersion(stdout); 2283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n", 2293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy GetClientName()); 2303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("\nImage Settings:\n"); 2313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (p=settings; *p != (char *) NULL; p++) 2323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf(" %s\n",*p); 2333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("\nImage Operators:\n"); 2343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (p=operators; *p != (char *) NULL; p++) 2353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf(" %s\n",*p); 2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("\nImage Sequence Operators:\n"); 2373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (p=sequence_operators; *p != (char *) NULL; p++) 2383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf(" %s\n",*p); 2393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("\nMiscellaneous Options:\n"); 2403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (p=miscellaneous; *p != (char *) NULL; p++) 2413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf(" %s\n",*p); 2423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 2433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "\nIn addition to those listed above, you can specify these standard X\n"); 2443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 2453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "resources as command line options: -background, -bordercolor,\n"); 2463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 247b797b2c96f796f4920c9ee807dc5f47e6f160418dirk " -alpha-color, -borderwidth, -font, -foreground, -iconGeometry,\n"); 248b797b2c96f796f4920c9ee807dc5f47e6f160418dirk (void) printf("-iconic, -name, -shared-memory, -usePixmap, or -title.\n"); 2493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 250e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony "\nBy default, the image format of 'file' is determined by its magic\n"); 2513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 2523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "number. To specify a particular image format, precede the filename\n"); 2533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 2543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "with an image format name and a colon (i.e. ps:image) or specify the\n"); 2553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf( 2563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n"); 2573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("'-' for standard input or output.\n"); 2583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf("\nButtons: \n"); 2593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (p=buttons; *p != (char *) NULL; p++) 2603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) printf(" %s\n",*p); 2613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickFalse); 2623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 2633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 2643ed852eea50f9d4cd633efb8c2b054b8e33c253cristyWandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, 2653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception) 2663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ 2673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#if defined(MAGICKCORE_X11_DELEGATE) 2683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define DestroyDisplay() \ 2693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \ 2703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((state & ExitState) == 0) \ 2713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyXResources(); \ 2723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (display != (Display *) NULL) \ 2733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { \ 2743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XCloseDisplay(display); \ 2753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy display=(Display *) NULL; \ 2763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } \ 2773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XDestroyResourceInfo(&resource_info); \ 2783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyImageStack(); \ 279bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (image_marker != (size_t *) NULL) \ 280bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_marker=(size_t *) RelinquishMagickMemory(image_marker); \ 281bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy for (i=0; i < (ssize_t) argc; i++) \ 2823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]=DestroyString(argv[i]); \ 2833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv=(char **) RelinquishMagickMemory(argv); \ 2843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 2853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define ThrowDisplayException(asperity,tag,option) \ 2863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \ 287efe601ce9ea5ad34ad0e8ad6e61d9be9b148b2a3cristy (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \ 2883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option); \ 2893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyDisplay(); \ 2903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickFalse); \ 2913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 2923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define ThrowDisplayInvalidArgumentException(option,argument) \ 2933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \ 2943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \ 295e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony "InvalidArgument","'%s': %s",option,argument); \ 2963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyDisplay(); \ 2973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickFalse); \ 2983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 2993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy char 3013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *resource_value, 3023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *server_name; 3033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy const char 3053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *option; 3063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Display 3083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *display; 3093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Image 3113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *image; 3123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ImageStack 3143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_stack[MaxImageStackDepth+1]; 3153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickBooleanType 317ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy fire, 318ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy pend, 319ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy respect_parenthesis; 3203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickStatusType 3223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy status; 3233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy QuantizeInfo 3253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *quantize_info; 3263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 327bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy register ssize_t 3283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i; 3293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 330bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy size_t 3313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *image_marker, 3323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy iterations, 3333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy last_image, 3343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state; 3353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3369d314ff2c17a77996c05413c2013880387e50f0ecristy ssize_t 3379d314ff2c17a77996c05413c2013880387e50f0ecristy image_number, 3389d314ff2c17a77996c05413c2013880387e50f0ecristy iteration, 3399d314ff2c17a77996c05413c2013880387e50f0ecristy j, 3409d314ff2c17a77996c05413c2013880387e50f0ecristy k, 3419d314ff2c17a77996c05413c2013880387e50f0ecristy l; 3429d314ff2c17a77996c05413c2013880387e50f0ecristy 3433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XResourceInfo 3443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info; 3453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XrmDatabase 3473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_database; 3483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 3493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 3503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Set defaults. 3513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 3523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy assert(image_info != (ImageInfo *) NULL); 353e1c94d9d25db6b0dd7a5028ffee31d1057855d73cristy assert(image_info->signature == MagickCoreSignature); 3543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (image_info->debug != MagickFalse) 3553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); 3563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy assert(exception != (ExceptionInfo *) NULL); 3573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (argc == 2) 3583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 3593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option=argv[1]; 3603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((LocaleCompare("version",option+1) == 0) || 3613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (LocaleCompare("-version",option+1) == 0)) 3623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 3634f7a61361f38ef4d3eaae0c74b9964a57aee813acristy ListMagickVersion(stdout); 364df0b2915c254e43ac809a58d5bba39e57d16012eCristy return(MagickTrue); 3653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 3663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 3673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy SetNotifyHandlers; 3683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy display=(Display *) NULL; 3693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy j=1; 3703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy k=0; 371bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_marker=(size_t *) NULL; 3723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_number=0; 3733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy last_image=0; 3743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy NewImageStack(); 3753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option=(char *) NULL; 3763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy pend=MagickFalse; 377ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy respect_parenthesis=MagickFalse; 3783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_database=(XrmDatabase) NULL; 3793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info)); 3803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy server_name=(char *) NULL; 3813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state=0; 3823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy status=MagickTrue; 3833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ReadCommandlLine(argc,&argv); 3843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy status=ExpandFilenames(&argc,&argv); 3853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (status == MagickFalse) 3863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed", 3873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy GetExceptionMessage(errno)); 388bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_marker=(size_t *) AcquireQuantumMemory((size_t) argc+1UL, 3893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy sizeof(*image_marker)); 390bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (image_marker == (size_t *) NULL) 3913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed", 3923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy GetExceptionMessage(errno)); 393cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy for (i=0; i <= (ssize_t) argc; i++) 394bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_marker[i]=(size_t) argc; 3953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 3963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Check for server name specified on the command line. 3973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 398bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy for (i=1; i < (ssize_t) argc; i++) 3993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 4003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 4013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Check command line for server name. 4023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 4033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option=argv[i]; 4043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("display",option+1) == 0) 4053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 4063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 4073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy User specified server name. 4083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 4093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 410bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 4113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 4123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy server_name=argv[i]; 4133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 4143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((LocaleCompare("help",option+1) == 0) || 4153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (LocaleCompare("-help",option+1) == 0)) 4163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(DisplayUsage()); 4173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 4183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 4193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Get user defaults from X resource database. 4203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 4213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy display=XOpenDisplay(server_name); 4223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (display == (Display *) NULL) 4233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(XServerError,"UnableToOpenXServer", 4243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XDisplayName(server_name)); 4253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) XSetErrorHandler(XError); 4263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_database=XGetResourceDatabase(display,GetClientName()); 4273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XGetResourceInfo(image_info,resource_database,GetClientName(), 4283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy &resource_info); 4293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info=resource_info.quantize_info; 4303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_info->density=XGetResourceInstance(resource_database,GetClientName(), 4313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "density",(char *) NULL); 4323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (image_info->density == (char *) NULL) 4333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_info->density=XGetScreenDensity(display); 4343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_value=XGetResourceInstance(resource_database,GetClientName(), 4353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "interlace","none"); 4363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_info->interlace=(InterlaceType) 437042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value); 4383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_info->page=XGetResourceInstance(resource_database,GetClientName(), 4393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "pageGeometry",(char *) NULL); 4403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_value=XGetResourceInstance(resource_database,GetClientName(), 4413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "quality","75"); 442e27293e706ca05b6b121e9512a83b16f7ad887f2cristy image_info->quality=StringToUnsignedLong(resource_value); 4433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_value=XGetResourceInstance(resource_database,GetClientName(), 4443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "verbose","False"); 4452e4501b56bdc589397786ecc59f8c2d206547a36anthony image_info->verbose=IsStringTrue(resource_value); 4463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_value=XGetResourceInstance(resource_database,GetClientName(), 4473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "dither","True"); 448cbda611068350bf4459f2dda1951f8823702e129cristy quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ? 449cbda611068350bf4459f2dda1951f8823702e129cristy RiemersmaDitherMethod : NoDitherMethod; 4503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 4513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Parse command line. 4523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 4533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy iteration=0; 454bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy for (i=1; ((i <= (ssize_t) argc) && ((state & ExitState) == 0)); i++) 4553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 456bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i < (ssize_t) argc) 4573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option=argv[i]; 4583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 4593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (image != (Image *) NULL) 4603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 4613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 4623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (isatty(STDIN_FILENO) != MagickFalse) 4633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option="logo:"; 4643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 465b3ed35eee125544e8d1b5bce9a8a848c36ba93b8cristy option="-"; 4663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare(option,"(") == 0) 4673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 4683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy FireImageStack(MagickFalse,MagickTrue,pend); 4693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (k == MaxImageStackDepth) 4703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply", 4713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option); 4723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy PushImageStack(); 4733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy continue; 4743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 4753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare(option,")") == 0) 4763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 4773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy FireImageStack(MagickFalse,MagickTrue,MagickTrue); 4783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (k == 0) 4793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnableToParseExpression",option); 4803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy PopImageStack(); 4813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy continue; 4823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 483042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy if (IsCommandOption(option) == MagickFalse) 4843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 4853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy const char 4863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *filename; 4873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 4883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Image 4895ca515760d11d78913ed38d03b6c14ad34068d32cristy *display_image, 4900d2c4cef237086ef14aebe809fea475453a09374cristy *image_list, 4913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *images; 4923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 4933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 4943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Option is a file name. 4953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 4963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy FireImageStack(MagickFalse,MagickFalse,pend); 4973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy filename=option; 498cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1))) 4993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy option=argv[++i]; 5013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy filename=option; 5023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 503151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy (void) CopyMagickString(image_info->filename,filename,MagickPathExtent); 5043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy images=ReadImage(image_info,exception); 5053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy CatchException(exception); 5063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy status&=(images != (Image *) NULL) && 5073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (exception->severity < ErrorException); 5083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (images == (Image *) NULL) 5093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy continue; 5103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy AppendImageStack(images); 5113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy FinalizeImageSettings(image_info,image,MagickFalse); 512f381638d20fad1367315df9b79eae3a89582fea2cristy iterations=0; 513e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 514f381638d20fad1367315df9b79eae3a89582fea2cristy iterations=image->iterations; 5150d2c4cef237086ef14aebe809fea475453a09374cristy image_list=CloneImageList(image,exception); 5160d2c4cef237086ef14aebe809fea475453a09374cristy if (image_list == (Image *) NULL) 5175ca515760d11d78913ed38d03b6c14ad34068d32cristy ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed", 5185ca515760d11d78913ed38d03b6c14ad34068d32cristy GetExceptionMessage(errno)); 5190d2c4cef237086ef14aebe809fea475453a09374cristy display_image=image_list; 5203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy do 5213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Transmogrify image as defined by the image processing options. 5243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 5253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.quantum=1; 5263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (resource_info.window_id != (char *) NULL) 5273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Display image to a specified X window. 5303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 5315ca515760d11d78913ed38d03b6c14ad34068d32cristy status=XDisplayBackgroundImage(display,&resource_info, 532051718b74ad68f8584cdac01d0192974ec777f1bcristy display_image,exception); 5333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (status != MagickFalse) 5343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state|=RetainColorsState; 5363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy status=MagickFalse; 5373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 538f023f7ed44533a4b0a1bdc721d672be5b835ec23cristy if (GetNextImageInList(display_image) == (Image *) NULL) 539f023f7ed44533a4b0a1bdc721d672be5b835ec23cristy state|=ExitState; 5403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 5423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy do 5433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Image 5453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *nexus; 5463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 5473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Display image to X server. 5493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 550588e8b91b002fd58328031cc4d4f23777b209622cristy if (resource_info.delay != 1) 5515ca515760d11d78913ed38d03b6c14ad34068d32cristy display_image->delay=resource_info.delay; 5525ca515760d11d78913ed38d03b6c14ad34068d32cristy nexus=XDisplayImage(display,&resource_info,argv,argc, 553051718b74ad68f8584cdac01d0192974ec777f1bcristy &display_image,&state,exception); 5543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (nexus == (Image *) NULL) 5553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 5563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy while ((nexus != (Image *) NULL) && ((state & ExitState) == 0)) 5573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Image 5593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *next; 5603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 5613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (nexus->montage != (char *) NULL) 5623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy User selected a visual directory image (montage). 5653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 5665ca515760d11d78913ed38d03b6c14ad34068d32cristy display_image=nexus; 5673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 5683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy next=XDisplayImage(display,&resource_info,argv,argc,&nexus, 570051718b74ad68f8584cdac01d0192974ec777f1bcristy &state,exception); 5713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((next == (Image *) NULL) && 5723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (GetNextImageInList(nexus) != (Image *) NULL)) 5733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5745ca515760d11d78913ed38d03b6c14ad34068d32cristy display_image=GetNextImageInList(nexus); 5753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy nexus=NewImageList(); 5763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 5783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5795ca515760d11d78913ed38d03b6c14ad34068d32cristy if (nexus != display_image) 5803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy nexus=DestroyImageList(nexus); 5813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy nexus=next; 5823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } while ((state & ExitState) == 0); 5853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (resource_info.write_filename != (char *) NULL) 5863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 5873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Write image. 5893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 5905ca515760d11d78913ed38d03b6c14ad34068d32cristy (void) CopyMagickString(display_image->filename, 591151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy resource_info.write_filename,MagickPathExtent); 592c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy (void) SetImageInfo(image_info,1,exception); 593c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy status&=WriteImage(image_info,display_image,exception); 5943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 5953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 5963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Proceed to next/previous image. 5973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 5983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((state & FormerImageState) != 0) 599cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy for (l=0; l < (ssize_t) resource_info.quantum; l++) 6003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6017f50403ec11e34c151f5a45943422c0affafa374cristy if (GetPreviousImageInList(display_image) == (Image *) NULL) 6023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6037f50403ec11e34c151f5a45943422c0affafa374cristy display_image=GetPreviousImageInList(display_image); 6043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 606cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy for (l=0; l < (ssize_t) resource_info.quantum; l++) 6073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6087f50403ec11e34c151f5a45943422c0affafa374cristy if (GetNextImageInList(display_image) == (Image *) NULL) 6093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6107f50403ec11e34c151f5a45943422c0affafa374cristy display_image=GetNextImageInList(display_image); 6113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 612a97d2c28f3a424f443b13a7579ae1df01d1c7689cristy if (l < (ssize_t) resource_info.quantum) 613a97d2c28f3a424f443b13a7579ae1df01d1c7689cristy break; 6145ca515760d11d78913ed38d03b6c14ad34068d32cristy } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0)); 6153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 6163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Free image resources. 6173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 618c1a5c90d0886f1b6b62e4770cad23bcfa703624fcristy display_image=DestroyImageList(display_image); 6193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((state & FormerImageState) == 0) 6203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 621bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy last_image=(size_t) image_number; 622bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_marker[i]=(size_t) image_number++; 6233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy else 6253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 6273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Proceed to previous image. 6283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 6293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy for (i--; i > 0; i--) 630bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (image_marker[i] == (size_t) (image_number-2)) 6313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy image_number--; 6333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 634e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if ((i == (ssize_t) argc) && ((state & ExitState) == 0)) 6353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i=0; 6363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((state & ExitState) != 0) 6373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy /* 6393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy Determine if we should proceed to the first image. 6403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy */ 6413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (image_number < 0) 6423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((state & FormerImageState) != 0) 6443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 646cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy for (i=1; i < (ssize_t) (argc-2); i++) 6473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (last_image == image_marker[i]) 6483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 649bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy image_number=(ssize_t) image_marker[i]+1; 6503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy continue; 6523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (resource_info.window_id != (char *) NULL) 6543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state|=ExitState; 655bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if ((iterations != 0) && (++iteration == (ssize_t) iterations)) 6563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state|=ExitState; 6573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare(filename,"-") == 0) 6583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy state|=ExitState; 6599a48b17ace21f903496c0f5d0870f997e1bc3ba8cristy RemoveAllImageStack(); 6603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy continue; 6613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy pend=image != (Image *) NULL ? MagickTrue : MagickFalse; 6633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy switch (*(option+1)) 6643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'a': 6663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("alpha",option+1) == 0) 6683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 669bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 6703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy type; 6713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 6723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 6733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 675bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 6763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 677288a3536ebe731f83c57b0856e64216b98e19362cristy type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]); 6783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (type < 0) 679b15b06c9f7ba2bf0e0ebcd88d0175536a5392c93cristy ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption", 6803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 6813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("antialias",option+1) == 0) 6843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("authenticate",option+1) == 0) 6863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 6873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 6883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 690bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 6913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 6923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("auto-orient",option+1) == 0) 6953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 6963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 6973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 6983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'b': 6993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("backdrop",option+1) == 0) 7013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse; 7033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("background",option+1) == 0) 7063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 710bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.background_color=argv[i]; 7133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("border",option+1) == 0) 7163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 720bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 7233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 7243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("bordercolor",option+1) == 0) 7273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 731bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.border_color=argv[i]; 7343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("borderwidth",option+1) == 0) 7373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.border_width=0; 7393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 742bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 7453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 746b70a486d55c723ec6da7e74c04edcec0598393cbcristy resource_info.border_width=(unsigned int) 747b70a486d55c723ec6da7e74c04edcec0598393cbcristy StringToUnsignedLong(argv[i]); 7483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 7513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'c': 7533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("cache",option+1) == 0) 7553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 759bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 7623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 7633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("channel",option+1) == 0) 7663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 767bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 7683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy channel; 7693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 7703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 773e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 7743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy channel=ParseChannelOption(argv[i]); 7763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (channel < 0) 7773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedChannelType", 7783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 7793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("clip",option+1) == 0) 7823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("clip-path",option+1) == 0) 7843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 786bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 7883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 7903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("coalesce",option+1) == 0) 7913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("colormap",option+1) == 0) 7933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 7943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.colormap=PrivateColormap; 7953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 7963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 7973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 798bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 7993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 8003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.colormap=UndefinedColormap; 8013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("private",argv[i]) == 0) 8023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.colormap=PrivateColormap; 8033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("shared",argv[i]) == 0) 8043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.colormap=SharedColormap; 8053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (resource_info.colormap == UndefinedColormap) 8063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedColormapType", 8073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 8083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("colors",option+1) == 0) 8113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 8123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info->number_colors=0; 8133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 816bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 8183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 8193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 820e27293e706ca05b6b121e9512a83b16f7ad887f2cristy quantize_info->number_colors=StringToUnsignedLong(argv[i]); 8213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("colorspace",option+1) == 0) 8243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 825bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 8263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy colorspace; 8273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 8283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 831bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 833042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy colorspace=ParseCommandOption(MagickColorspaceOptions, 8343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickFalse,argv[i]); 8353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (colorspace < 0) 8363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedColorspace", 8373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 8383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("comment",option+1) == 0) 8413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 8423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 845bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 8473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("compress",option+1) == 0) 8503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 851bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 8523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy compress; 8533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 8543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 857bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 859042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy compress=ParseCommandOption(MagickCompressOptions,MagickFalse, 8603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 8613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (compress < 0) 8623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedImageCompression", 8633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 8643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8662287975e02162155f1500d91ccce6e0fde5de7c8cristy if (LocaleCompare("concurrent",option+1) == 0) 8672287975e02162155f1500d91ccce6e0fde5de7c8cristy break; 8683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("contrast",option+1) == 0) 8693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("crop",option+1) == 0) 8713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 8723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 875bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 8773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 8783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 8793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 8823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 8833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'd': 8843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 8853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("debug",option+1) == 0) 8863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 887bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 8883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy event; 8893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 8903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 8913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 8923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 893bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 8943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 895042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]); 8963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (event < 0) 8973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedEventType", 8983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 8993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) SetLogEventMask(argv[i]); 9003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("decipher",option+1) == 0) 9033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 907e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 9083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("define",option+1) == 0) 9123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 914bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy const char 9193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *define; 9203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 9213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy define=GetImageOption(image_info,argv[i]); 9223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (define == (const char *) NULL) 9233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"NoSuchOption",argv[i]); 9243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("delay",option+1) == 0) 9293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 933bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 9363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 9373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("density",option+1) == 0) 9403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 944bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 9473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 9483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("depth",option+1) == 0) 9513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 955bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 9583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 9593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("deskew",option+1) == 0) 9623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 966e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 9673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 9693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 9703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("despeckle",option+1) == 0) 9733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("display",option+1) == 0) 9753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 9763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 979bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 9813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("dispose",option+1) == 0) 9843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 985bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 9863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy dispose; 9873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 9883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 9893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 991bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 9923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 993042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]); 9943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (dispose < 0) 9953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod", 9963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 9973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 9983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 9993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("dither",option+1) == 0) 10003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1001bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 10023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy method; 10033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 1004cbda611068350bf4459f2dda1951f8823702e129cristy quantize_info->dither_method=NoDitherMethod; 10053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 10063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1008bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 10093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1010042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]); 10113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (method < 0) 10123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedDitherMethod", 10133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 10143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info->dither_method=(DitherMethod) method; 10153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10172287975e02162155f1500d91ccce6e0fde5de7c8cristy if (LocaleCompare("duration",option+1) == 0) 10182287975e02162155f1500d91ccce6e0fde5de7c8cristy { 10192287975e02162155f1500d91ccce6e0fde5de7c8cristy if (*option == '+') 10202287975e02162155f1500d91ccce6e0fde5de7c8cristy break; 10212287975e02162155f1500d91ccce6e0fde5de7c8cristy i++; 1022e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 10232287975e02162155f1500d91ccce6e0fde5de7c8cristy ThrowDisplayException(OptionError,"MissingArgument",option); 10242287975e02162155f1500d91ccce6e0fde5de7c8cristy if (IsGeometry(argv[i]) == MagickFalse) 10252287975e02162155f1500d91ccce6e0fde5de7c8cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 10262287975e02162155f1500d91ccce6e0fde5de7c8cristy break; 10272287975e02162155f1500d91ccce6e0fde5de7c8cristy } 10283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 10293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'e': 10313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 10323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("edge",option+1) == 0) 10333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 10343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 10353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1037bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 10383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 10393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 10403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 10413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("endian",option+1) == 0) 10443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1045bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 10463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy endian; 10473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 10483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 10493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1051bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 10523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1053042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy endian=ParseCommandOption(MagickEndianOptions,MagickFalse, 10543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 10553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (endian < 0) 10563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedEndianType", 10573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 10583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("enhance",option+1) == 0) 10613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("equalize",option+1) == 0) 10633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("extract",option+1) == 0) 10653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 10663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 10673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1069bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 10703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 10713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 10723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 10733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 10763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'f': 10783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 10793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("filter",option+1) == 0) 10803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1081bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 10823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy filter; 10833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 10843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 10853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1087bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 10883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1089042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]); 10903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (filter < 0) 10913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedImageFilter", 10923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 10933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 10953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("flatten",option+1) == 0) 10963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("flip",option+1) == 0) 10983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 10993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("flop",option+1) == 0) 11003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("font",option+1) == 0) 11023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1106bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 11073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.font=XGetResourceClass(resource_database, 11093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy GetClientName(),"font",argv[i]); 11103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("foreground",option+1) == 0) 11133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1117bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 11183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.foreground_color=argv[i]; 11203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("format",option+1) == 0) 11233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1127e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 11283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("frame",option+1) == 0) 11323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1136bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 11373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 11393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 11403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("fuzz",option+1) == 0) 11433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1147e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 11483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 11503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 11513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 11543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'g': 11563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("gamma",option+1) == 0) 11583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1160bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 11613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 11633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 11643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("geometry",option+1) == 0) 11673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 11683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.image_geometry=(char *) NULL; 11693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 1171151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy (void) CopyMagickString(argv[i]+1,"sans",MagickPathExtent); 11723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1173bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 11743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 11753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 11763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 11773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.image_geometry=ConstantString(argv[i]); 11783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("gravity",option+1) == 0) 11813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1182bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 11833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy gravity; 11843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 11853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 11863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1188e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 11893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1190042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy gravity=ParseCommandOption(MagickGravityOptions,MagickFalse, 11913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 11923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (gravity < 0) 11933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedGravityType", 11943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 11953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 11963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 11983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 11993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'h': 12003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((LocaleCompare("help",option+1) == 0) || 12023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (LocaleCompare("-help",option+1) == 0)) 12033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 12053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'i': 12073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("identify",option+1) == 0) 12093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("iconGeometry",option+1) == 0) 12113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.icon_geometry=(char *) NULL; 12133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 12143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1216bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 12173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 12183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 12193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 12203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.icon_geometry=argv[i]; 12213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("iconic",option+1) == 0) 12243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse; 12263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("immutable",option+1) == 0) 12293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse; 12313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("interlace",option+1) == 0) 12343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1235bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 12363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy interlace; 12373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 12383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 12393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1241bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 12423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1243042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse, 12443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 12453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (interlace < 0) 12463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedInterlaceType", 12473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 12483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("interpolate",option+1) == 0) 12513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1252bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 12533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy interpolate; 12543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 12553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 12563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1258bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 12593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1260042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse, 12613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 12623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (interpolate < 0) 12633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod", 12643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 12653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 12683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'l': 12703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("label",option+1) == 0) 12723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 12743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1276bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 12773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 12783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 12803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("limit",option+1) == 0) 12813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 12823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy char 12833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *p; 12843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 12853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy double 12863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy value; 12873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 1288bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 12893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource; 12903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 12913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 12923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 12933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1294bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 12953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1296042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy resource=ParseCommandOption(MagickResourceOptions,MagickFalse, 12973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 12983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (resource < 0) 12993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedResourceType", 13003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 13013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1302bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 13033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1304dbdd0e35efc03c9bccda644f5407db38b7c17eeccristy value=StringToDouble(argv[i],&p); 1305da16f16767eb31921af855f17bda465fffc4e000cristy (void) value; 13063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0)) 13073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 13083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("list",option+1) == 0) 13113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1312bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 13133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy list; 13143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 13153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1318bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 13193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1320042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]); 13213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (list < 0) 13223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]); 1323aeb2cbc4eb61cc6a04744db1dc52f5319c466e29cristy status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **) 13243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv+j,exception); 13253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyDisplay(); 132632ce2391bb7051ac53c7c3c25d3ad8f41836824dcristy return(status == 0 ? MagickTrue : MagickFalse); 13273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("log",option+1) == 0) 13293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1333bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if ((i == (ssize_t) argc) || 13343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (strchr(argv[i],'%') == (char *) NULL)) 13353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 13363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("loop",option+1) == 0) 13393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1343e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 13443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 13453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 13463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 1347e27293e706ca05b6b121e9512a83b16f7ad887f2cristy iterations=StringToUnsignedLong(argv[i]); 13483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 13513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'm': 13533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("magnify",option+1) == 0) 13553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.magnify=2; 13573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1360bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 13613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 13623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 13633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 1364e27293e706ca05b6b121e9512a83b16f7ad887f2cristy resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]); 13653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("map",option+1) == 0) 13683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.map_type=(char *) NULL; 13703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) strcpy(argv[i]+1,"san"); 13733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1374bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 13753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 13763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.map_type=argv[i]; 13773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("matte",option+1) == 0) 13803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 1381b797b2c96f796f4920c9ee807dc5f47e6f160418dirk if (LocaleCompare("alpha-color",option+1) == 0) 13823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1386bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 13873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1388b797b2c96f796f4920c9ee807dc5f47e6f160418dirk resource_info.alpha_color=argv[i]; 13893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 13913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("monitor",option+1) == 0) 13923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("monochrome",option+1) == 0) 13943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 13953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 13963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 13973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info->number_colors=2; 13983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info->colorspace=GRAYColorspace; 13993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 14023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'n': 14043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("name",option+1) == 0) 14063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.name=(char *) NULL; 14083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 14093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1411bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.name=ConstantString(argv[i]); 14143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("negate",option+1) == 0) 14173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("noop",option+1) == 0) 14193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("normalize",option+1) == 0) 14213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 14233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'p': 14253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("page",option+1) == 0) 14273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.image_geometry=(char *) NULL; 14293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 14303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1432bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.image_geometry=ConstantString(argv[i]); 14353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("profile",option+1) == 0) 14383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1440bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 14453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'q': 14473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("quality",option+1) == 0) 14493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 14513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1453bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 14563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 14573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("quantize",option+1) == 0) 14603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1461bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 14623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy colorspace; 14633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 14643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 14653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1467e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 14683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1469042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy colorspace=ParseCommandOption(MagickColorspaceOptions, 14703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickFalse,argv[i]); 14713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (colorspace < 0) 14723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedColorspace", 14733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 14743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("quiet",option+1) == 0) 14773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 14793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'r': 14813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("raise",option+1) == 0) 14833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1485bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 14883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 14893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 14913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("regard-warnings",option+1) == 0) 14923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 14933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("remote",option+1) == 0) 14943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 14953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1496bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 14973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 14983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0) 14993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickFalse); 15003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i--; 15013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("repage",option+1) == 0) 15043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1508bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("resample",option+1) == 0) 15153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1519e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 15203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("resize",option+1) == 0) 15263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1530bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleNCompare("respect-parentheses",option+1,17) == 0) 15373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse; 15393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("roll",option+1) == 0) 15423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1546bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("rotate",option+1) == 0) 15533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1555bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 15623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 's': 15643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("sample",option+1) == 0) 15663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1570bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("sampling-factor",option+1) == 0) 15773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1581bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 15843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("scenes",option+1) == 0) 15883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 15893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 15903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1592bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 15933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 15943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse) 15953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 15963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 15973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 15983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("seed",option+1) == 0) 15993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1603e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 16043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 16063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 16073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("segment",option+1) == 0) 16103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1614bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 16173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 16183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("set",option+1) == 0) 16213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1623bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1628bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("sharpen",option+1) == 0) 16333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1637bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 16403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 16413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("shared-memory",option+1) == 0) 16443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.use_shared_memory= (*option == '-') ? MagickTrue : 16463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickFalse; 16473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("size",option+1) == 0) 16503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1654bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 16573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 16583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("strip",option+1) == 0) 16613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("support",option+1) == 0) 16633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; /* deprecated */ 16653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 16683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 't': 16703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("text-font",option+1) == 0) 16723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.text_font=(char *) NULL; 16743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1677bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.text_font=XGetResourceClass(resource_database, 16803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy GetClientName(),"font",argv[i]); 16813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("texture",option+1) == 0) 16843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1688bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 16923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("threshold",option+1) == 0) 16933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 16943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 16953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 16963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1697bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 16983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 16993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 17003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 17013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("thumbnail",option+1) == 0) 17043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1708bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 17093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 17113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 17123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("title",option+1) == 0) 17153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.title=(char *) NULL; 17173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1720bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 17213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.title=argv[i]; 17233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("transparent-color",option+1) == 0) 17263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1730e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 17313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("treedepth",option+1) == 0) 17353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy quantize_info->tree_depth=0; 17373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1740bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 17413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 17433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 1744e27293e706ca05b6b121e9512a83b16f7ad887f2cristy quantize_info->tree_depth=StringToUnsignedLong(argv[i]); 17453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("trim",option+1) == 0) 17483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 17503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'u': 17523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("update",option+1) == 0) 17543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.update=(unsigned int) (*option == '-'); 17563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1759bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 17603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsGeometry(argv[i]) == MagickFalse) 17623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayInvalidArgumentException(option,argv[i]); 1763e27293e706ca05b6b121e9512a83b16f7ad887f2cristy resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]); 17643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("use-pixmap",option+1) == 0) 17673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.use_pixmap=(*option == '-') ? MagickTrue : 17693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy MagickFalse; 17703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 17733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'v': 17753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("verbose",option+1) == 0) 17773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if ((LocaleCompare("version",option+1) == 0) || 17793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (LocaleCompare("-version",option+1) == 0)) 17803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17814f7a61361f38ef4d3eaae0c74b9964a57aee813acristy ListMagickVersion(stdout); 17823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("visual",option+1) == 0) 17853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 17863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.visual_type=(char *) NULL; 17873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 17883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1790bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 17913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 17923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.visual_type=argv[i]; 17933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 17943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 17953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("virtual-pixel",option+1) == 0) 17963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 1797bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy ssize_t 17983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy method; 17993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 18003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 18013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1803e81f552f8ca2fc16632bd9830db3f93af07d514ccristy if (i == (ssize_t) argc) 18043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1805042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse, 18063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy argv[i]); 18073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (method < 0) 18083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError, 18093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy "UnrecognizedVirtualPixelMethod",argv[i]); 18103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 18133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case 'w': 18153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("window",option+1) == 0) 18173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.window_id=(char *) NULL; 18193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 18203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1822bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 18233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 18243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.window_id=argv[i]; 18253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("window-group",option+1) == 0) 18283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.window_group=(char *) NULL; 18303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 18313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1833bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 18343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 1835dbdd0e35efc03c9bccda644f5407db38b7c17eeccristy if (StringToDouble(argv[i],(char **) NULL) != 0) 18363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.window_group=argv[i]; 18373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (LocaleCompare("write",option+1) == 0) 18403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.write_filename=(char *) NULL; 18423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (*option == '+') 18433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy i++; 1845bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy if (i == (ssize_t) argc) 18463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"MissingArgument",option); 18473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.write_filename=argv[i]; 18483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (IsPathAccessible(resource_info.write_filename) != MagickFalse) 18493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy char 18513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy answer[2], 18523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy *p; 18533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy 1854b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy (void) FormatLocaleFile(stderr,"Overwrite %s? ", 18553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy resource_info.write_filename); 18563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy p=fgets(answer,(int) sizeof(answer),stdin); 1857da16f16767eb31921af855f17bda465fffc4e000cristy (void) p; 18583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (((*answer != 'y') && (*answer != 'Y'))) 18593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(MagickFalse); 18603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 18643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy case '?': 18663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy break; 18673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy default: 18683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnrecognizedOption",option); 18693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 1870042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) & 1871042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy FireOptionFlag) == 0 ? MagickFalse : MagickTrue; 18723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (fire != MagickFalse) 18733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy FireImageStack(MagickFalse,MagickTrue,MagickTrue); 18743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (k != 0) 18763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]); 18773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy if (state & RetainColorsState) 18783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy { 18793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display))); 18803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) XSync(display,MagickFalse); 18813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy } 18823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy DestroyDisplay(); 18833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(status != 0 ? MagickTrue : MagickFalse); 18843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#else 18853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) argc; 18863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) argv; 18873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError, 1888e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename); 18893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy return(DisplayUsage()); 18903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif 18913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} 1892