home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / ImageMagick-4.0.6.tar.gz / ImageMagick-4.0.6.tar / ImageMagick-4.0.6 / mogrify.c < prev    next >
Text File  |  1998-04-22  |  49KB  |  1,297 lines

  1. /*
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %                                                                             %
  4. %                                                                             %
  5. %                                                                             %
  6. %              M   M   OOO    GGGG  RRRR   IIIII  FFFFF  Y   Y                %
  7. %              MM MM  O   O  G      R   R    I    F       Y Y                 %
  8. %              M M M  O   O  G GG   RRRRR    I    FFF      Y                  %
  9. %              M   M  O   O  G   G  R R      I    F        Y                  %
  10. %              M   M   OOO    GGG   R  R   IIIII  F        Y                  %
  11. %                                                                             %
  12. %                                                                             %
  13. %               Transmogrify an Image or Sequence of Images.                  %
  14. %                                                                             %
  15. %                                                                             %
  16. %                                                                             %
  17. %                           Software Design                                   %
  18. %                             John Cristy                                     %
  19. %                            December 1992                                    %
  20. %                                                                             %
  21. %                                                                             %
  22. %  Copyright 1998 E. I. du Pont de Nemours and Company                        %
  23. %                                                                             %
  24. %  Permission is hereby granted, free of charge, to any person obtaining a    %
  25. %  copy of this software and associated documentation files ("ImageMagick"),  %
  26. %  to deal in ImageMagick without restriction, including without limitation   %
  27. %  the rights to use, copy, modify, merge, publish, distribute, sublicense,   %
  28. %  and/or sell copies of ImageMagick, and to permit persons to whom the       %
  29. %  ImageMagick is furnished to do so, subject to the following conditions:    %
  30. %                                                                             %
  31. %  The above copyright notice and this permission notice shall be included in %
  32. %  all copies or substantial portions of ImageMagick.                         %
  33. %                                                                             %
  34. %  The software is provided "as is", without warranty of any kind, express or %
  35. %  implied, including but not limited to the warranties of merchantability,   %
  36. %  fitness for a particular purpose and noninfringement.  In no event shall   %
  37. %  E. I. du Pont de Nemours and Company be liable for any claim, damages or   %
  38. %  other liability, whether in an action of contract, tort or otherwise,      %
  39. %  arising from, out of or in connection with ImageMagick or the use or other %
  40. %  dealings in ImageMagick.                                                   %
  41. %                                                                             %
  42. %  Except as contained in this notice, the name of the E. I. du Pont de       %
  43. %  Nemours and Company shall not be used in advertising or otherwise to       %
  44. %  promote the sale, use or other dealings in ImageMagick without prior       %
  45. %  written authorization from the E. I. du Pont de Nemours and Company.       %
  46. %                                                                             %
  47. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  48. %
  49. %  `Mogrify' applies one or more image transforms to an image or sequence of
  50. %   images and overwrites the original image.
  51. %
  52. %  The Mogrify program command syntax is:
  53. %
  54. %  Usage: mogrify [options ...] file [ [options ...] file ...]
  55. %
  56. %  Where options include:
  57. %    -align type          Left, Center, Right
  58. %    -blur factor         apply a filter to blur the image
  59. %    -border geometry     surround image with a border of color
  60. %    -box color           color for annotation bounding box
  61. %    -charcoal factor     simulate a charcoal drawing
  62. %    -colorize value      colorize the image with the pen color
  63. %    -colors value        preferred number of colors in the image
  64. %    -colorspace type     alternate image colorspace
  65. %    -comment string      annotate image with comment
  66. %    -compress type       None, JPEG, LZW, RunlengthEncoded, or Zip
  67. %    -contrast            enhance or reduce the image contrast
  68. %    -crop geometry       preferred size and location of the cropped image
  69. %    -cycle amount        cycle the image colormap
  70. %    -delay value         display the next image after pausing
  71. %    -density geometry    vertical and horizontal density of the image
  72. %    -despeckle           reduce the speckles within an image",
  73. %    -display server      obtain image or font from this X server
  74. %    -dispose method      GIF disposal method
  75. %    -dither              apply Floyd/Steinberg error diffusion to image
  76. %    -draw string         annotate the image with a graphic primitive
  77. %    -edge factor         apply a filter to detect edges in the image
  78. %    -emboss              emboss an image
  79. %    -enhance             apply a digital filter to enhance a noisy image
  80. %    -equalize            perform histogram equalization to an image
  81. %    -flip                flip image in the vertical direction
  82. %    -flop                flop image in the horizontal direction
  83. %    -font name           X11 font for displaying text
  84. %    -format type         image format type
  85. %    -frame geometry      surround image with an ornamental border
  86. %    -gamma value         level of gamma correction
  87. %    -geometry geometry   perferred size or location of the image
  88. %    -implode amount      implode image pixels about the center
  89. %    -interlace type      None, Line, Plane, or Partition
  90. %    -label name          assign a label to an image
  91. %    -layer type          Red, Green, Blue, Matte
  92. %    -linewidth value     width of line in pixels
  93. %    -loop iterations     add Netscape loop extension to your GIF animation
  94. %    -map filename        transform image colors to match this set of colors
  95. %    -matte               store matte channel if the image has one
  96. %    -modulate value      vary the brightness, saturation, and hue
  97. %    -monochrome          transform image to black and white
  98. %    -negate              apply color inversion to image
  99. %    -noise               add or reduce noise in an image
  100. %    -normalize           transform image to span the full range of colors
  101. %    -opaque color        change this color to the pen color
  102. %    -page geometry       size and location of an image canvas
  103. %    -paint radius        simulate an oil painting
  104. %    -pen color           color for annotating or changing opaque color
  105. %    -pointsize value     pointsize of Postscript font
  106. %    -quality value       JPEG/MIFF/PNG compression level
  107. %    -raise value         lighten/darken image edges to create a 3-D effect
  108. %    -region geometry     apply options to a portion of the image
  109. %    -roll geometry       roll an image vertically or horizontally
  110. %    -rotate degrees      apply Paeth rotation to the image
  111. %    -sample geometry     scale image with pixel sampling
  112. %    -scene value         image scene number
  113. %    -seed value          pseudo-random number generator seed value
  114. %    -segment values      segment an image
  115. %    -shade degrees       shade the image using a distant light source
  116. %    -sharpen factor      apply a filter to sharpen the image
  117. %    -shear geometry      slide one edge of the image along the X or Y axis
  118. %    -size geometry       width and height of image
  119. %    -solarize thresold   negate all pixels above the threshold level
  120. %    -spread amount       displace image pixels by a random amount
  121. %    -swirl degrees       swirl image pixels about the center
  122. %    -texture filename    name of texture to tile onto the image background
  123. %    -threshold value     threshold the image
  124. %    -transparent color   make this color transparent within the image
  125. %    -treedepth value     depth of the color classification tree
  126. %    -undercolor geometry control undercolor removal and black generation
  127. %    -verbose             print detailed information about the image
  128. %    -view                FlashPix viewing transforms
  129. %    -wave geometry       alter an image along a sine wave
  130. %
  131. %  By default, the image format of `file' is determined by its magic
  132. %  number.  To specify a particular image format, precede the filename
  133. %  with an image format name and a colon (i.e. ps:image) or specify the
  134. %  image type as the filename suffix (i.e. image.ps).  Specify 'file' as
  135. %  '-' for standard input or output.
  136. %
  137. %
  138. */
  139.  
  140. /*
  141.   Include declarations.
  142. */
  143. #include "magick.h"
  144. #include "version.h"
  145.  
  146. /*
  147. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  148. %                                                                             %
  149. %                                                                             %
  150. %                                                                             %
  151. %   U s a g e                                                                 %
  152. %                                                                             %
  153. %                                                                             %
  154. %                                                                             %
  155. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  156. %
  157. %  Function Usage displays the program command syntax.
  158. %
  159. %  The format of the Usage routine is:
  160. %
  161. %      Usage(client_name)
  162. %
  163. %    o client_name: a character string representing the name of the client
  164. %      program.
  165. %
  166. %
  167. */
  168. static void Usage(const char *client_name)
  169. {
  170.   char
  171.     **p;
  172.  
  173.   static char
  174.     *options[]=
  175.     {
  176.       "-align type          Left, Center, Right",
  177.       "-blur factor         apply a filter to blur the image",
  178.       "-border geometry     surround image with a border of color",
  179.       "-box color           color for annotation bounding box",
  180.       "-charcoal factor     simulate a charcoal drawing",
  181.       "-colorize value      colorize the image with the pen color",
  182.       "-colors value        preferred number of colors in the image",
  183.       "-colorspace type     alternate image colorspace",
  184.       "-comment string      annotate image with comment",
  185.       "-compress type       None, JPEG, LZW, RunlengthEncoded, or Zip",
  186.       "-contrast            enhance or reduce the image contrast",
  187.       "-crop geometry       preferred size and location of the cropped image",
  188.       "-cycle amount        cycle the image colormap",
  189.       "-delay value         display the next image after pausing",
  190.       "-density geometry    vertical and horizontal density of the image",
  191.       "-despeckle           reduce the speckles within an image",
  192.       "-display server      obtain image or font from this X server",
  193.       "-dispose method      GIF disposal method",
  194.       "-dither              apply Floyd/Steinberg error diffusion to image",
  195.       "-draw string         annotate the image with a graphic primitive",
  196.       "-edge factor         apply a filter to detect edges in the image",
  197.       "-emboss              emboss an image",
  198.       "-enhance             apply a digital filter to enhance a noisy image",
  199.       "-equalize            perform histogram equalization to an image",
  200.       "-flip                flip image in the vertical direction",
  201.       "-flop                flop image in the horizontal direction",
  202.       "-font name           X11 font for displaying text",
  203.       "-format type         image format type",
  204.       "-frame geometry      surround image with an ornamental border",
  205.       "-gamma value         level of gamma correction",
  206.       "-geometry geometry   perferred size or location of the image",
  207.       "-implode amount      implode image pixels about the center",
  208.       "-interlace type      None, Line, Plane, or Partition",
  209.       "-label name          assign a label to an image",
  210.       "-layer type          Red, Green, Blue, Matte",
  211.       "-linewidth value     width of line in pixels",
  212.       "-loop iterations     add Netscape loop extension to your GIF animation",
  213.       "-map filename        transform image colors to match this set of colors",
  214.       "-matte               store matte channel if the image has one",
  215.       "-modulate value      vary the brightness, saturation, and hue",
  216.       "-monochrome          transform image to black and white",
  217.       "-negate              apply color inversion to image",
  218.       "-noise               add or reduce noise in an image.",
  219.       "-normalize           transform image to span the full range of colors",
  220.       "-opaque color        change this color to the pen color",
  221.       "-page geometry       size and location of an image canvas",
  222.       "-paint radius        simulate an oil painting",
  223.       "-pen color           color for annotating or changing opaque color",
  224.       "-pointsize value     pointsize of Postscript font",
  225.       "-quality value       JPEG/MIFF/PNG compression level",
  226.       "-raise value         lighten/darken image edges to create a 3-D effect",
  227.       "-region geometry     apply options to a portion of the image",
  228.       "-roll geometry       roll an image vertically or horizontally",
  229.       "-rotate degrees      apply Paeth rotation to the image",
  230.       "-sample geometry     scale image with pixel sampling",
  231.       "-scene number        image scene number",
  232.       "-seed value          pseudo-random number generator seed value",
  233.       "-segment values      segment an image",
  234.       "-shade degrees       shade the image using a distant light source",
  235.       "-sharpen factor      apply a filter to sharpen the image",
  236.       "-shear geometry      slide one edge of the image along the X or Y axis",
  237.       "-size geometry       width and height of image",
  238.       "-solarize thresold   negate all pixels above the threshold level",
  239.       "-spread amount       displace image pixels by a random amount",
  240.       "-swirl degrees       swirl image pixels about the center",
  241.       "-texture filename    name of texture to tile onto the image background",
  242.       "-threshold value     threshold the image",
  243.       "-transparent color   make this color transparent within the image",
  244.       "-treedepth value     depth of the color classification tree",
  245.       "-undercolor geometry control undercolor removal and black generation",
  246.       "-verbose             print detailed information about the image",
  247.       "-view                FlashPix viewing transforms",
  248.       "-wave geometry       alter an image along a sine wave",
  249.       (char *) NULL
  250.     };
  251.  
  252.   (void) printf("Version: %s\n",Version);
  253.   (void) printf("Copyright: %s\n\n",Copyright);
  254.   (void) printf(
  255.     "Usage: %s [-options ...] file [ [-options ...] file ...]\n",client_name);
  256.   (void) printf("\nWhere options include: \n");
  257.   for (p=options; *p != (char *) NULL; p++)
  258.     (void) printf("  %s\n",*p);
  259.   (void) printf(
  260.     "\nBy default, the image format of `file' is determined by its magic\n");
  261.   (void) printf(
  262.     "number.  To specify a particular image format, precede the filename\n");
  263.   (void) printf(
  264.     "with an image format name and a colon (i.e. ps:image) or specify the\n");
  265.   (void) printf(
  266.     "image type as the filename suffix (i.e. image.ps).  Specify 'file' as\n");
  267.   (void) printf("'-' for standard input or output.\n");
  268.   Exit(0);
  269. }
  270.  
  271. /*
  272. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  273. %                                                                             %
  274. %                                                                             %
  275. %                                                                             %
  276. %    M a i n                                                                  %
  277. %                                                                             %
  278. %                                                                             %
  279. %                                                                             %
  280. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  281. %
  282. %
  283. */
  284. int main(int argc,char **argv)
  285. {
  286.   char
  287.     *client_name,
  288.     filename[MaxTextExtent],
  289.     *format,
  290.     *option;
  291.  
  292.   ImageInfo
  293.     image_info;
  294.  
  295.   Image
  296.     *image;
  297.  
  298.   int
  299.     x;
  300.  
  301.   register int
  302.     i;
  303.  
  304.   unsigned int
  305.     global_colormap,
  306.     scene,
  307.     status;
  308.  
  309.   /*
  310.     Display usage profile if there are no command line arguments.
  311.   */
  312.   ReadCommandlLine(argc,&argv);
  313.   client_name=SetClientName(*argv);
  314.   if (argc < 2)
  315.     Usage(client_name);
  316.   /*
  317.     Set defaults.
  318.   */
  319.   format=(char *) NULL;
  320.   global_colormap=False;
  321.   image=(Image *) NULL;
  322.   GetImageInfo(&image_info);
  323.   scene=0;
  324.   /*
  325.     Parse command line.
  326.   */
  327.   ExpandFilenames(&argc,&argv);
  328.   for (i=1; i < argc; i++)
  329.   {
  330.     option=argv[i];
  331.     if ((Extent(option) > 1) && ((*option == '-') || (*option == '+')))
  332.       switch (*(option+1))
  333.       {
  334.         case 'a':
  335.         {
  336.           if (strncmp("align",option+1,2) == 0)
  337.             {
  338.               int
  339.                 alignment;
  340.  
  341.               alignment=UndefinedAlignment;
  342.               if (*option == '-')
  343.                 {
  344.                   i++;
  345.                   if (i == argc)
  346.                     MagickError(OptionError,"Missing type",option);
  347.                   option=argv[i];
  348.                   alignment=UndefinedAlignment;
  349.                   if (Latin1Compare("Left",option) == 0)
  350.                     alignment=LeftAlignment;
  351.                   if (Latin1Compare("Center",option) == 0)
  352.                     alignment=CenterAlignment;
  353.                   if (Latin1Compare("Right",option) == 0)
  354.                     alignment=RightAlignment;
  355.                   if (alignment == UndefinedAlignment)
  356.                     MagickError(OptionError,"Invalid alignment type",option);
  357.                 }
  358.               break;
  359.             }
  360.           MagickError(OptionError,"Unrecognized option",option);
  361.           break;
  362.         }
  363.         case 'b':
  364.         {
  365.           if (strncmp("blur",option+1,3) == 0)
  366.             {
  367.               if (*option == '-')
  368.                 {
  369.                   i++;
  370.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  371.                     MagickError(OptionError,"Missing factor",option);
  372.                 }
  373.               break;
  374.             }
  375.           if (strncmp("border",option+1,7) == 0)
  376.             {
  377.               if (*option == '-')
  378.                 {
  379.                   i++;
  380.                   if ((i == argc) || !IsGeometry(argv[i]))
  381.                     MagickError(OptionError,"Missing geometry",option);
  382.                 }
  383.               break;
  384.             }
  385.           if (strncmp("bordercolor",option+1,7) == 0)
  386.             {
  387.               if (*option == '-')
  388.                 {
  389.                   i++;
  390.                   if (i == argc)
  391.                     MagickError(OptionError,"Missing border color",option);
  392.                 }
  393.               break;
  394.             }
  395.           if (strncmp("box",option+1,3) == 0)
  396.             {
  397.               image_info.box=(char *) NULL;
  398.               if (*option == '-')
  399.                 {
  400.                   i++;
  401.                   if (i == argc)
  402.                     MagickError(OptionError,"Missing box color",option);
  403.                   image_info.box=argv[i];
  404.                 }
  405.               break;
  406.             }
  407.           MagickError(OptionError,"Unrecognized option",option);
  408.           break;
  409.         }
  410.         case 'c':
  411.         {
  412.           if (strncmp("charcoal",option+1,3) == 0)
  413.             {
  414.               if (*option == '-')
  415.                 {
  416.                   i++;
  417.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  418.                     MagickError(OptionError,"Missing factor",option);
  419.                 }
  420.               break;
  421.             }
  422.           if (strncmp("colorize",option+1,7) == 0)
  423.             {
  424.               if (*option == '-')
  425.                 {
  426.                   i++;
  427.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  428.                     MagickError(OptionError,"Missing value",option);
  429.                 }
  430.               break;
  431.             }
  432.           if (strncmp("colors",option+1,7) == 0)
  433.             {
  434.               if (*option == '-')
  435.                 {
  436.                   i++;
  437.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  438.                     MagickError(OptionError,"Missing colors",option);
  439.                 }
  440.               break;
  441.             }
  442.           if (strncmp("colorspace",option+1,7) == 0)
  443.             {
  444.               if (*option == '-')
  445.                 {
  446.                   i++;
  447.                   if (i == argc)
  448.                     MagickError(OptionError,"Missing type",option);
  449.                   option=argv[i];
  450.                   image_info.colorspace=UndefinedColorspace;
  451.                   if (Latin1Compare("cmyk",option) == 0)
  452.                     image_info.colorspace=CMYKColorspace;
  453.                   if (Latin1Compare("gray",option) == 0)
  454.                     image_info.colorspace=GRAYColorspace;
  455.                   if (Latin1Compare("ohta",option) == 0)
  456.                     image_info.colorspace=OHTAColorspace;
  457.                   if (Latin1Compare("rgb",option) == 0)
  458.                     image_info.colorspace=RGBColorspace;
  459.                   if (Latin1Compare("transparent",option) == 0)
  460.                     image_info.colorspace=TransparentColorspace;
  461.                   if (Latin1Compare("xyz",option) == 0)
  462.                     image_info.colorspace=XYZColorspace;
  463.                   if (Latin1Compare("ycbcr",option) == 0)
  464.                     image_info.colorspace=YCbCrColorspace;
  465.                   if (Latin1Compare("yiq",option) == 0)
  466.                     image_info.colorspace=YIQColorspace;
  467.                   if (Latin1Compare("ypbpr",option) == 0)
  468.                     image_info.colorspace=YPbPrColorspace;
  469.                   if (Latin1Compare("yuv",option) == 0)
  470.                     image_info.colorspace=YUVColorspace;
  471.                   if (image_info.colorspace == UndefinedColorspace)
  472.                     MagickError(OptionError,"Invalid colorspace type",option);
  473.                 }
  474.               break;
  475.             }
  476.           if (strncmp("comment",option+1,4) == 0)
  477.             {
  478.               if (*option == '-')
  479.                 {
  480.                   i++;
  481.                   if (i == argc)
  482.                     MagickError(OptionError,"Missing comment",option);
  483.                 }
  484.               break;
  485.             }
  486.           if (strncmp("compress",option+1,5) == 0)
  487.             {
  488.               image_info.compression=NoCompression;
  489.               if (*option == '-')
  490.                 {
  491.                   i++;
  492.                   if (i == argc)
  493.                     MagickError(OptionError,"Missing type",option);
  494.                   option=argv[i];
  495.                   image_info.compression=UndefinedCompression;
  496.                   if (Latin1Compare("None",option) == 0)
  497.                     image_info.compression=NoCompression;
  498.                   if (Latin1Compare("JPEG",option) == 0)
  499.                     image_info.compression=JPEGCompression;
  500.                   if (Latin1Compare("LZW",option) == 0)
  501.                     image_info.compression=LZWCompression;
  502.                   if (Latin1Compare("RunlengthEncoded",option) == 0)
  503.                     image_info.compression=RunlengthEncodedCompression;
  504.                   if (Latin1Compare("Zip",option) == 0)
  505.                     image_info.compression=ZipCompression;
  506.                   if (image_info.compression == UndefinedCompression)
  507.                     MagickError(OptionError,"Invalid compression type",option);
  508.                 }
  509.               break;
  510.             }
  511.           if (strncmp("contrast",option+1,3) == 0)
  512.             break;
  513.           if (strncmp("crop",option+1,2) == 0)
  514.             {
  515.               if (*option == '-')
  516.                 {
  517.                   i++;
  518.                   if ((i == argc) || !IsGeometry(argv[i]))
  519.                     MagickError(OptionError,"Missing geometry",option);
  520.                 }
  521.               break;
  522.             }
  523.           if (strncmp("cycle",option+1,2) == 0)
  524.             {
  525.               if (*option == '-')
  526.                 {
  527.                   i++;
  528.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  529.                     MagickError(OptionError,"Missing amount",option);
  530.                 }
  531.               break;
  532.             }
  533.           MagickError(OptionError,"Unrecognized option",option);
  534.           break;
  535.         }
  536.         case 'd':
  537.         {
  538.           if (strncmp("delay",option+1,3) == 0)
  539.             {
  540.               image_info.delay=(char *) NULL;
  541.               if (*option == '-')
  542.                 {
  543.                   i++;
  544.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  545.                     MagickError(OptionError,"Missing delay",option);
  546.                   image_info.delay=PostscriptGeometry(argv[i]);
  547.                 }
  548.               break;
  549.             }
  550.           if (strncmp("density",option+1,3) == 0)
  551.             {
  552.               image_info.density=(char *) NULL;
  553.               if (*option == '-')
  554.                 {
  555.                   i++;
  556.                   if ((i == argc) || !IsGeometry(argv[i]))
  557.                     MagickError(OptionError,"Missing geometry",option);
  558.                   image_info.density=argv[i];
  559.                 }
  560.               break;
  561.             }
  562.           if (strncmp("despeckle",option+1,3) == 0)
  563.             break;
  564.           if (strcmp("display",option+1) == 0)
  565.             {
  566.               image_info.server_name=(char *) NULL;
  567.               if (*option == '-')
  568.                 {
  569.                   i++;
  570.                   if (i == argc)
  571.                     MagickError(OptionError,"Missing server name",option);
  572.                   image_info.server_name=argv[i];
  573.                 }
  574.               break;
  575.             }
  576.           if (strncmp("dispose",option+1,5) == 0)
  577.             {
  578.               image_info.dispose=(char *) NULL;
  579.               if (*option == '-')
  580.                 {
  581.                   i++;
  582.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  583.                     MagickError(OptionError,"Missing method",option);
  584.                   image_info.dispose=PostscriptGeometry(argv[i]);
  585.                 }
  586.               break;
  587.             }
  588.           if (strncmp("dither",option+1,3) == 0)
  589.             {
  590.               image_info.dither=(*option == '-');
  591.               break;
  592.             }
  593.           if (strncmp("draw",option+1,2) == 0)
  594.             {
  595.               if (*option == '-')
  596.                 {
  597.                   i++;
  598.                   if (i == argc)
  599.                     MagickError(OptionError,"Missing primitive",option);
  600.                 }
  601.               break;
  602.             }
  603.           MagickError(OptionError,"Unrecognized option",option);
  604.           break;
  605.         }
  606.         case 'e':
  607.         {
  608.           if (strncmp("edge",option+1,2) == 0)
  609.             {
  610.               if (*option == '-')
  611.                 {
  612.                   i++;
  613.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  614.                     MagickError(OptionError,"Missing factor",option);
  615.                 }
  616.               break;
  617.             }
  618.           if (strncmp("emboss",option+1,2) == 0)
  619.             break;
  620.           if (strncmp("enhance",option+1,2) == 0)
  621.             break;
  622.           if (strncmp("equalize",option+1,2) == 0)
  623.             break;
  624.           MagickError(OptionError,"Unrecognized option",option);
  625.           break;
  626.         }
  627.         case 'f':
  628.         {
  629.           if (strncmp("flip",option+1,3) == 0)
  630.             break;
  631.           if (strncmp("flop",option+1,3) == 0)
  632.             break;
  633.           if (strncmp("font",option+1,3) == 0)
  634.             {
  635.               image_info.font=(char *) NULL;
  636.               if (*option == '-')
  637.                 {
  638.                   i++;
  639.                   if (i == argc)
  640.                     MagickError(OptionError,"Missing font name",option);
  641.                   image_info.font=argv[i];
  642.                 }
  643.               break;
  644.             }
  645.           if (strncmp("format",option+1,3) == 0)
  646.             {
  647.               format=(char *) NULL;
  648.               if (*option == '-')
  649.                 {
  650.                   i++;
  651.                   if (i == argc)
  652.                     MagickError(OptionError,"Missing image type",option);
  653.                   format=argv[i];
  654.                   (void) strcpy(image_info.filename,format);
  655.                   (void) strcat(image_info.filename,":");
  656.                   SetImageInfo(&image_info,False);
  657.                   if (*image_info.magick == '\0')
  658.                     MagickError(OptionError,"Unrecognized image format",format);
  659.                 }
  660.               break;
  661.             }
  662.           if (strncmp("frame",option+1,2) == 0)
  663.             {
  664.               if (*option == '-')
  665.                 {
  666.                   i++;
  667.                   if ((i == argc) || !IsGeometry(argv[i]))
  668.                     MagickError(OptionError,"Missing geometry",option);
  669.                 }
  670.               break;
  671.             }
  672.           MagickError(OptionError,"Unrecognized option",option);
  673.           break;
  674.         }
  675.         case 'g':
  676.         {
  677.           if (strncmp("gamma",option+1,2) == 0)
  678.             {
  679.               i++;
  680.               if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  681.                 MagickError(OptionError,"Missing value",option);
  682.               break;
  683.             }
  684.           if (strncmp("geometry",option+1,2) == 0)
  685.             {
  686.               if (*option == '-')
  687.                 {
  688.                   i++;
  689.                   if ((i == argc) || !IsGeometry(argv[i]))
  690.                     MagickError(OptionError,"Missing geometry",option);
  691.                 }
  692.               break;
  693.             }
  694.           MagickError(OptionError,"Unrecognized option",option);
  695.           break;
  696.         }
  697.         case 'h':
  698.         {
  699.           if (strncmp("help",option+1,2) == 0)
  700.             {
  701.               Usage(client_name);
  702.               break;
  703.             }
  704.           MagickError(OptionError,"Unrecognized option",option);
  705.           break;
  706.         }
  707.         case 'i':
  708.         {
  709.           if (strncmp("implode",option+1,2) == 0)
  710.             {
  711.               if (*option == '-')
  712.                 {
  713.                   i++;
  714.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  715.                     MagickError(OptionError,"Missing amount",option);
  716.                 }
  717.               break;
  718.             }
  719.           if (strncmp("interlace",option+1,3) == 0)
  720.             {
  721.               image_info.interlace=NoInterlace;
  722.               if (*option == '-')
  723.                 {
  724.                   i++;
  725.                   if (i == argc)
  726.                     MagickError(OptionError,"Missing type",option);
  727.                   option=argv[i];
  728.                   image_info.interlace=UndefinedInterlace;
  729.                   if (Latin1Compare("None",option) == 0)
  730.                     image_info.interlace=NoInterlace;
  731.                   if (Latin1Compare("Line",option) == 0)
  732.                     image_info.interlace=LineInterlace;
  733.                   if (Latin1Compare("Plane",option) == 0)
  734.                     image_info.interlace=PlaneInterlace;
  735.                   if (Latin1Compare("Partition",option) == 0)
  736.                     image_info.interlace=PartitionInterlace;
  737.                   if (image_info.interlace == UndefinedInterlace)
  738.                     MagickError(OptionError,"Invalid interlace type",option);
  739.                 }
  740.               break;
  741.             }
  742.           MagickError(OptionError,"Unrecognized option",option);
  743.           break;
  744.         }
  745.         case 'l':
  746.         {
  747.           if (strncmp("label",option+1,3) == 0)
  748.             {
  749.               if (*option == '-')
  750.                 {
  751.                   i++;
  752.                   if (i == argc)
  753.                     MagickError(OptionError,"Missing label name",option);
  754.                 }
  755.               break;
  756.             }
  757.           if (strncmp("layer",option+1,3) == 0)
  758.             {
  759.               if (*option == '-')
  760.                 {
  761.                   LayerType
  762.                     layer;
  763.  
  764.                   i++;
  765.                   if (i == argc)
  766.                     MagickError(OptionError,"Missing type",option);
  767.                   option=argv[i];
  768.                   layer=UndefinedLayer;
  769.                   if (Latin1Compare("Red",option) == 0)
  770.                     layer=RedLayer;
  771.                   if (Latin1Compare("Green",option) == 0)
  772.                     layer=GreenLayer;
  773.                   if (Latin1Compare("Blue",option) == 0)
  774.                     layer=BlueLayer;
  775.                   if (Latin1Compare("Matte",option) == 0)
  776.                     layer=MatteLayer;
  777.                   if (layer == UndefinedLayer)
  778.                     MagickError(OptionError,"Invalid layer type",option);
  779.                 }
  780.               break;
  781.             }
  782.           if (strncmp("linewidth",option+1,2) == 0)
  783.             {
  784.               if (*option == '-')
  785.                 {
  786.                   i++;
  787.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  788.                     MagickError(OptionError,"Missing size",option);
  789.                 }
  790.               break;
  791.             }
  792.           if (strncmp("loop",option+1,2) == 0)
  793.             {
  794.               image_info.iterations=(char *) NULL;
  795.               if (*option == '-')
  796.                 {
  797.                   i++;
  798.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  799.                     MagickError(OptionError,"Missing iterations",option);
  800.                   image_info.iterations=PostscriptGeometry(argv[i]);
  801.                 }
  802.               break;
  803.             }
  804.           MagickError(OptionError,"Unrecognized option",option);
  805.           break;
  806.         }
  807.         case 'm':
  808.         {
  809.           if (strncmp("map",option+1,3) == 0)
  810.             {
  811.               global_colormap=(*option == '+');
  812.               if (*option == '-')
  813.                 {
  814.                   i++;
  815.                   if (i == argc)
  816.                     MagickError(OptionError,"Missing file name",option);
  817.                 }
  818.               break;
  819.             }
  820.           if (strcmp("matte",option+1) == 0)
  821.             break;
  822.           if (strncmp("mattecolor",option+1,6) == 0)
  823.             {
  824.               if (*option == '-')
  825.                 {
  826.                   i++;
  827.                   if (i == argc)
  828.                     MagickError(OptionError,"Missing matte color",option);
  829.                 }
  830.               break;
  831.             }
  832.           if (strncmp("modulate",option+1,3) == 0)
  833.             {
  834.               if (*option == '-')
  835.                 {
  836.                   i++;
  837.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  838.                     MagickError(OptionError,"Missing value",option);
  839.                 }
  840.               break;
  841.             }
  842.           if (strncmp("monochrome",option+1,4) == 0)
  843.             {
  844.               image_info.monochrome=(*option == '-');
  845.               break;
  846.             }
  847.           MagickError(OptionError,"Unrecognized option",option);
  848.           break;
  849.         }
  850.         case 'n':
  851.         {
  852.           if (strncmp("negate",option+1,3) == 0)
  853.             break;
  854.          if (strncmp("noise",option+1,3) == 0)
  855.             {
  856.               if (*option == '+')
  857.                 {
  858.                   i++;
  859.                   if (i == argc)
  860.                     MagickError(OptionError,"Missing type",option);
  861.                   option=argv[i];
  862.                   if ((Latin1Compare("uniform",option) != 0) &&
  863.                       (Latin1Compare("gaussian",option) != 0) &&
  864.                       (Latin1Compare("multiplicative",option) != 0) &&
  865.                       (Latin1Compare("impulse",option) != 0) &&
  866.                       (Latin1Compare("laplacian",option) != 0) &&
  867.                       (Latin1Compare("poisson",option) != 0))
  868.                     MagickError(OptionError,"Invalid noise type",option);
  869.                 }
  870.               break;
  871.             }
  872.           if (strncmp("normalize",option+1,3) == 0)
  873.             break;
  874.           MagickError(OptionError,"Unrecognized option",option);
  875.           break;
  876.         }
  877.         case 'o':
  878.         {
  879.           if (strncmp("opaque",option+1,2) == 0)
  880.             {
  881.               if (*option == '-')
  882.                 {
  883.                   i++;
  884.                   if (i == argc)
  885.                     MagickError(OptionError,"Missing opaque color",option);
  886.                 }
  887.               break;
  888.             }
  889.           MagickError(OptionError,"Unrecognized option",option);
  890.           break;
  891.         }
  892.         case 'p':
  893.         {
  894.           if (strncmp("page",option+1,3) == 0)
  895.             {
  896.               image_info.page=(char *) NULL;
  897.               if (*option == '-')
  898.                 {
  899.                   i++;
  900.                   if (i == argc)
  901.                     MagickError(OptionError,"Missing page geometry",option);
  902.                   image_info.page=PostscriptGeometry(argv[i]);
  903.                 }
  904.               break;
  905.             }
  906.           if (strncmp("paint",option+1,3) == 0)
  907.             {
  908.               if (*option == '-')
  909.                 {
  910.                   i++;
  911.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  912.                     MagickError(OptionError,"Missing radius",option);
  913.                 }
  914.               break;
  915.             }
  916.           if (strncmp("pen",option+1,2) == 0)
  917.             {
  918.               image_info.pen=(char *) NULL;
  919.               if (*option == '-')
  920.                 {
  921.                   i++;
  922.                   if (i == argc)
  923.                     MagickError(OptionError,"Missing pen color",option);
  924.                   image_info.pen=argv[i];
  925.                 }
  926.               break;
  927.             }
  928.           if (strncmp("pointsize",option+1,2) == 0)
  929.             {
  930.               image_info.pointsize=atoi(DefaultPointSize);
  931.               if (*option == '-')
  932.                 {
  933.                   i++;
  934.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  935.                     MagickError(OptionError,"Missing size",option);
  936.                   image_info.pointsize=atoi(argv[i]);
  937.                 }
  938.               break;
  939.             }
  940.           MagickError(OptionError,"Unrecognized option",option);
  941.           break;
  942.         }
  943.         case 'q':
  944.         {
  945.           if (strncmp("quality",option+1,2) == 0)
  946.             {
  947.               image_info.quality=atoi(DefaultImageQuality);
  948.               if (*option == '-')
  949.                 {
  950.                   i++;
  951.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  952.                     MagickError(OptionError,"Missing quality",option);
  953.                   image_info.quality=atoi(argv[i]);
  954.                 }
  955.               break;
  956.             }
  957.           MagickError(OptionError,"Unrecognized option",option);
  958.           break;
  959.         }
  960.         case 'r':
  961.         {
  962.           if (strncmp("raise",option+1,2) == 0)
  963.             {
  964.               i++;
  965.               if ((i == argc) || !sscanf(argv[i],"%d",&x))
  966.                 MagickError(OptionError,"Missing bevel width",option);
  967.               break;
  968.             }
  969.           if (strncmp("region",option+1,3) == 0)
  970.             {
  971.               if (*option == '-')
  972.                 {
  973.                   i++;
  974.                   if ((i == argc) || !IsGeometry(argv[i]))
  975.                     MagickError(OptionError,"Missing geometry",option);
  976.                 }
  977.               break;
  978.             }
  979.           if (strncmp("roll",option+1,3) == 0)
  980.             {
  981.               if (*option == '-')
  982.                 {
  983.                   i++;
  984.                   if ((i == argc) || !IsGeometry(argv[i]))
  985.                     MagickError(OptionError,"Missing geometry",option);
  986.                 }
  987.               break;
  988.             }
  989.           if (strncmp("rotate",option+1,3) == 0)
  990.             {
  991.               if (*option == '-')
  992.                 {
  993.                   i++;
  994.                   if ((i == argc) || !IsGeometry(argv[i]))
  995.                     MagickError(OptionError,"Missing degrees",option);
  996.                 }
  997.               break;
  998.             }
  999.           MagickError(OptionError,"Unrecognized option",option);
  1000.           break;
  1001.         }
  1002.         case 's':
  1003.         {
  1004.           if (strncmp("sample",option+1,2) == 0)
  1005.             {
  1006.               if (*option == '-')
  1007.                 {
  1008.                   i++;
  1009.                   if ((i == argc) || !IsGeometry(argv[i]))
  1010.                     MagickError(OptionError,"Missing geometry",option);
  1011.                 }
  1012.               break;
  1013.             }
  1014.           if (strncmp("scene",option+1,3) == 0)
  1015.             {
  1016.               scene=0;
  1017.               if (*option == '-')
  1018.                 {
  1019.                   i++;
  1020.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1021.                     MagickError(OptionError,"Missing scene number",option);
  1022.                   scene=atoi(argv[i]);
  1023.                 }
  1024.               break;
  1025.             }
  1026.           if (strncmp("seed",option+1,3) == 0)
  1027.             {
  1028.               if (*option == '-')
  1029.                 {
  1030.                   i++;
  1031.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1032.                     MagickError(OptionError,"Missing value",option);
  1033.                 }
  1034.               srand((unsigned int) atoi(argv[i]));
  1035.               break;
  1036.             }
  1037.           if (strncmp("segment",option+1,3) == 0)
  1038.             {
  1039.               if (*option == '-')
  1040.                 {
  1041.                   i++;
  1042.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  1043.                     MagickError(OptionError,"Missing threshold",option);
  1044.                 }
  1045.               break;
  1046.             }
  1047.           if (strncmp("shade",option+1,5) == 0)
  1048.             {
  1049.               i++;
  1050.               if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1051.                 MagickError(OptionError,"Missing azimuth",option);
  1052.               break;
  1053.             }
  1054.           if (strncmp("sharpen",option+1,5) == 0)
  1055.             {
  1056.               if (*option == '-')
  1057.                 {
  1058.                   i++;
  1059.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  1060.                     MagickError(OptionError,"Missing factor",option);
  1061.                 }
  1062.               break;
  1063.             }
  1064.           if (strncmp("shear",option+1,3) == 0)
  1065.             {
  1066.               if (*option == '-')
  1067.                 {
  1068.                   i++;
  1069.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  1070.                     MagickError(OptionError,"Missing geometry",option);
  1071.                 }
  1072.               break;
  1073.             }
  1074.           if (strncmp("size",option+1,2) == 0)
  1075.             {
  1076.               image_info.size=(char *) NULL;
  1077.               if (*option == '-')
  1078.                 {
  1079.                   i++;
  1080.                   if ((i == argc) || !IsGeometry(argv[i]))
  1081.                     MagickError(OptionError,"Missing geometry",option);
  1082.                   image_info.size=argv[i];
  1083.                 }
  1084.               break;
  1085.             }
  1086.           if (strncmp("solarize",option+1,2) == 0)
  1087.             {
  1088.               if (*option == '-')
  1089.                 {
  1090.                   i++;
  1091.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1092.                     MagickError(OptionError,"Missing threshold",option);
  1093.                 }
  1094.               break;
  1095.             }
  1096.           if (strncmp("spread",option+1,2) == 0)
  1097.             {
  1098.               if (*option == '-')
  1099.                 {
  1100.                   i++;
  1101.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1102.                     MagickError(OptionError,"Missing amount",option);
  1103.                 }
  1104.               break;
  1105.             }
  1106.           if (strncmp("swirl",option+1,2) == 0)
  1107.             {
  1108.               if (*option == '-')
  1109.                 {
  1110.                   i++;
  1111.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  1112.                     MagickError(OptionError,"Missing degrees",option);
  1113.                 }
  1114.               break;
  1115.             }
  1116.           MagickError(OptionError,"Unrecognized option",option);
  1117.           break;
  1118.         }
  1119.         case 't':
  1120.         {
  1121.           if (strncmp("texture",option+1,5) == 0)
  1122.             {
  1123.               image_info.texture=(char *) NULL;
  1124.               if (*option == '-')
  1125.                 {
  1126.                   i++;
  1127.                   if (i == argc)
  1128.                     MagickError(OptionError,"Missing filename",option);
  1129.                   image_info.texture=argv[i];
  1130.                 }
  1131.               break;
  1132.             }
  1133.           if (strncmp("threshold",option+1,2) == 0)
  1134.             {
  1135.               if (*option == '-')
  1136.                 {
  1137.                   i++;
  1138.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1139.                     MagickError(OptionError,"Missing value",option);
  1140.                 }
  1141.               break;
  1142.             }
  1143.           if (strncmp("transparent",option+1,3) == 0)
  1144.             {
  1145.               if (*option == '-')
  1146.                 {
  1147.                   i++;
  1148.                   if (i == argc)
  1149.                     MagickError(OptionError,"Missing transparent color",option);
  1150.                 }
  1151.               break;
  1152.             }
  1153.           if (strncmp("treedepth",option+1,3) == 0)
  1154.             {
  1155.               if (*option == '-')
  1156.                 {
  1157.                   i++;
  1158.                   if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1159.                     MagickError(OptionError,"Missing depth",option);
  1160.                 }
  1161.               break;
  1162.             }
  1163.           MagickError(OptionError,"Unrecognized option",option);
  1164.           break;
  1165.         }
  1166.         case 'u':
  1167.         {
  1168.           if (strncmp("undercolor",option+1,2) == 0)
  1169.             {
  1170.               image_info.undercolor=(char *) NULL;
  1171.               if (*option == '-')
  1172.                 {
  1173.                   i++;
  1174.                   if ((i == argc) || !sscanf(argv[i],"%f",(float *) &x))
  1175.                     MagickError(OptionError,"Missing undercolor geometry",
  1176.                       option);
  1177.                   image_info.undercolor=argv[i];
  1178.                 }
  1179.               break;
  1180.             }
  1181.           MagickError(OptionError,"Unrecognized option",option);
  1182.           break;
  1183.         }
  1184.         case 'v':
  1185.         {
  1186.           if (strncmp("verbose",option+1,2) == 0)
  1187.             {
  1188.               image_info.verbose=(*option == '-');
  1189.               break;
  1190.             }
  1191.           if (strncmp("view",option+1,3) == 0)
  1192.             {
  1193.               image_info.view=(char *) NULL;
  1194.               if (*option == '-')
  1195.                 {
  1196.                   i++;
  1197.                   if (i == argc)
  1198.                     MagickError(OptionError,"Missing view transform",option);
  1199.                   image_info.view=argv[i];
  1200.                 }
  1201.               break;
  1202.             }
  1203.           MagickError(OptionError,"Unrecognized option",option);
  1204.           break;
  1205.         }
  1206.         case 'w':
  1207.         {
  1208.           if (strcmp("wave",option+1) == 0)
  1209.             {
  1210.               i++;
  1211.               if ((i == argc) || !sscanf(argv[i],"%d",&x))
  1212.                 MagickError(OptionError,"Missing amplitude",option);
  1213.               break;
  1214.             }
  1215.           MagickError(OptionError,"Unrecognized option",option);
  1216.           break;
  1217.         }
  1218.         case '?':
  1219.         {
  1220.           Usage(client_name);
  1221.           break;
  1222.         }
  1223.         default:
  1224.         {
  1225.           MagickError(OptionError,"Unrecognized option",option);
  1226.           break;
  1227.         }
  1228.       }
  1229.     else
  1230.       {
  1231.         /*
  1232.           Option is a file name: begin by reading image from specified file.
  1233.         */
  1234.         (void) strcpy(image_info.filename,argv[i]);
  1235.         image=ReadImage(&image_info);
  1236.         if (image == (Image *) NULL)
  1237.           if (*option == '-')
  1238.             break;
  1239.           else
  1240.             continue;
  1241.         if (scene != 0)
  1242.           image->scene=scene;
  1243.         if (format != (char *) NULL)
  1244.           {
  1245.             register char
  1246.               *p;
  1247.  
  1248.             /*
  1249.               Modify filename to include a user specified image format.
  1250.             */
  1251.             p=image->filename+Extent(image->filename)-1;
  1252.             while ((*p != '.') && (p > image->filename))
  1253.               p--;
  1254.             p++;
  1255.             if (strcmp(p,image->magick) == 0)
  1256.               (void) strcpy(p,format);
  1257.             else
  1258.               {
  1259.                 (void) sprintf(image_info.filename,"%s:%s",format,
  1260.                   image->filename);
  1261.                 (void) strcpy(image->filename,image_info.filename);
  1262.               }
  1263.           }
  1264.         /*
  1265.           Transmogrify image as defined by the image processing options.
  1266.         */
  1267.         MogrifyImages(&image_info,i,argv,&image);
  1268.         if (global_colormap)
  1269.           MapImages(image,(Image *) NULL,image_info.dither);
  1270.         /*
  1271.           Write transmogified image to disk.
  1272.         */
  1273.         if ((strcmp(image_info.filename,"-") == 0) || (format != (char *) NULL))
  1274.           {
  1275.             if (format != (char *) NULL)
  1276.               AppendImageFormat(format,image->filename);
  1277.             (void) WriteImage(&image_info,image);
  1278.             DestroyImage(image);
  1279.             continue;
  1280.           }
  1281.         (void) strcpy(filename,image->filename);
  1282.         LocaleFilename(image->filename);
  1283.         status=WriteImage(&image_info,image);
  1284.         if (status == True)
  1285.           {
  1286.             (void) remove(filename);
  1287.             (void) rename(image->filename,filename);
  1288.           }
  1289.         DestroyImage(image);
  1290.       }
  1291.     }
  1292.   if (image == (Image *) NULL)
  1293.     MagickError(OptionError,"Missing an image file name",(char *) NULL);
  1294.   Exit(0);
  1295.   return(False);
  1296. }
  1297.