stream.c

Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                 SSSSS  TTTTT  RRRR   EEEEE   AAA   M   M                    %
00007 %                 SS       T    R   R  E      A   A  MM MM                    %
00008 %                  SSS     T    RRRR   EEE    AAAAA  M M M                    %
00009 %                    SS    T    R R    E      A   A  M   M                    %
00010 %                 SSSSS    T    R  R   EEEEE  A   A  M   M                    %
00011 %                                                                             %
00012 %                                                                             %
00013 %                     Stream Image to a Raw Image Format                      %
00014 %                                                                             %
00015 %                           Software Design                                   %
00016 %                             John Cristy                                     %
00017 %                              July 1992                                      %
00018 %                                                                             %
00019 %                                                                             %
00020 %  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization      %
00021 %  dedicated to making software imaging solutions freely available.           %
00022 %                                                                             %
00023 %  You may not use this file except in compliance with the License.  You may  %
00024 %  obtain a copy of the License at                                            %
00025 %                                                                             %
00026 %    http://www.imagemagick.org/script/license.php                            %
00027 %                                                                             %
00028 %  Unless required by applicable law or agreed to in writing, software        %
00029 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00030 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00031 %  See the License for the specific language governing permissions and        %
00032 %  limitations under the License.                                             %
00033 %                                                                             %
00034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00035 %
00036 %  Use Stream is a lightweight utility designed to extract pixels from large
00037 %  image files to a raw format using a minimum of system resources.  The
00038 %  entire image or any regular portion of the image can be extracted.
00039 %
00040 %
00041 */
00042 
00043 /*
00044   Include declarations.
00045 */
00046 #include "wand/studio.h"
00047 #include "wand/MagickWand.h"
00048 #include "wand/mogrify-private.h"
00049 #include "magick/stream-private.h"
00050 
00051 /*
00052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00053 %                                                                             %
00054 %                                                                             %
00055 %                                                                             %
00056 %   S t r e a m I m a g e C o m m a n d                                       %
00057 %                                                                             %
00058 %                                                                             %
00059 %                                                                             %
00060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00061 %
00062 %  StreamImageCommand() is a lightweight method designed to extract pixels
00063 %  from large image files to a raw format using a minimum of system resources.
00064 %  The entire image or any regular portion of the image can be extracted.
00065 %
00066 %  The format of the StreamImageCommand method is:
00067 %
00068 %      MagickBooleanType StreamImageCommand(ImageInfo *image_info,int argc,
00069 %        char **argv,char **metadata,ExceptionInfo *exception)
00070 %
00071 %  A description of each parameter follows:
00072 %
00073 %    o image_info: the image info.
00074 %
00075 %    o argc: the number of elements in the argument vector.
00076 %
00077 %    o argv: A text array containing the command line arguments.
00078 %
00079 %    o metadata: any metadata is returned here.
00080 %
00081 %    o exception: return any errors or warnings in this structure.
00082 %
00083 %
00084 */
00085 
00086 static void StreamUsage(void)
00087 {
00088   const char
00089     **p;
00090 
00091   static const char
00092     *miscellaneous[]=
00093     {
00094       "-debug events        display copious debugging information",
00095       "-help                print program options",
00096       "-list type           print a list of supported option arguments",
00097       "-log format          format of debugging information",
00098       "-version             print version information",
00099       (char *) NULL
00100     },
00101     *settings[]=
00102     {
00103       "-authenticate password",
00104       "                     decipher image with this password",
00105       "-channel type        apply option to select image channels",
00106       "-colorspace type     alternate image colorspace",
00107       "-compress type       type of pixel compression when writing the image",
00108       "-define format:option",
00109       "                     define one or more image format options",
00110       "-density geometry    horizontal and vertical density of the image",
00111       "-depth value         image depth",
00112       "-extract geometry    extract area from image",
00113       "-identify            identify the format and characteristics of the image",
00114       "-interlace type      type of image interlacing scheme",
00115       "-interpolate method  pixel color interpolation method",
00116       "-limit type value    pixel cache resource limit",
00117       "-map components      one or more pixel components",
00118       "-monitor             monitor progress",
00119       "-quantize colorspace reduce colors in this colorspace",
00120       "-quiet               suppress all warning messages",
00121       "-regard-warnings     pay attention to warning messages",
00122       "-respect-parenthesis settings remain in effect until parenthesis boundary",
00123       "-sampling-factor geometry",
00124       "                     horizontal and vertical sampling factor",
00125       "-seed value          seed a new sequence of pseudo-random numbers",
00126       "-set attribute value set an image attribute",
00127       "-size geometry       width and height of image",
00128       "-storage-type type   pixel storage type",
00129       "-transparent-color color",
00130       "                     transparent color",
00131       "-verbose             print detailed information about the image",
00132       "-virtual-pixel method",
00133       "                     virtual pixel access method",
00134       (char *) NULL
00135     };
00136 
00137   (void) printf("Version: %s\n",GetMagickVersion((unsigned long *) NULL));
00138   (void) printf("Copyright: %s\n\n",GetMagickCopyright());
00139   (void) printf("Usage: %s [options ...] input-image raw-image\n",
00140     GetClientName());
00141   (void) printf("\nImage Settings:\n");
00142   for (p=settings; *p != (char *) NULL; p++)
00143     (void) printf("  %s\n",*p);
00144   (void) printf("\nMiscellaneous Options:\n");
00145   for (p=miscellaneous; *p != (char *) NULL; p++)
00146     (void) printf("  %s\n",*p);
00147   (void) printf(
00148     "\nBy default, the image format of `file' is determined by its magic\n");
00149   (void) printf(
00150     "number.  To specify a particular image format, precede the filename\n");
00151   (void) printf(
00152     "with an image format name and a colon (i.e. ps:image) or specify the\n");
00153   (void) printf(
00154     "image type as the filename suffix (i.e. image.ps).  Specify 'file' as\n");
00155   (void) printf("'-' for standard input or output.\n");
00156   exit(0);
00157 }
00158 
00159 WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info,
00160   int argc,char **argv,char **metadata,ExceptionInfo *exception)
00161 {
00162 #define DestroyStream() \
00163 { \
00164   DestroyImageStack(); \
00165   stream_info=DestroyStreamInfo(stream_info); \
00166   for (i=0; i < (long) argc; i++) \
00167     argv[i]=DestroyString(argv[i]); \
00168   argv=(char **) RelinquishMagickMemory(argv); \
00169 }
00170 #define ThrowStreamException(asperity,tag,option) \
00171 { \
00172   (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
00173     option); \
00174   DestroyStream(); \
00175   return(MagickFalse); \
00176 }
00177 #define ThrowStreamInvalidArgumentException(option,argument) \
00178 { \
00179   (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
00180     "InvalidArgument","`%s': %s",argument,option); \
00181   DestroyStream(); \
00182   return(MagickFalse); \
00183 }
00184 
00185   char
00186     *filename,
00187     *option;
00188 
00189   const char
00190     *format;
00191 
00192   Image
00193     *image;
00194 
00195   ImageStack
00196     image_stack[MaxImageStackDepth+1];
00197 
00198   long
00199     j,
00200     k;
00201 
00202   MagickBooleanType
00203     fire,
00204     pend;
00205 
00206   MagickStatusType
00207     status;
00208 
00209   register long
00210     i;
00211 
00212   StreamInfo
00213     *stream_info;
00214 
00215   /*
00216     Set defaults.
00217   */
00218   assert(image_info != (ImageInfo *) NULL);
00219   assert(image_info->signature == MagickSignature);
00220   if (image_info->debug != MagickFalse)
00221     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
00222   assert(exception != (ExceptionInfo *) NULL);
00223   (void) metadata;
00224   if (argc == 2)
00225     {
00226       option=argv[1];
00227       if ((LocaleCompare("version",option+1) == 0) ||
00228           (LocaleCompare("-version",option+1) == 0))
00229         {
00230           (void) fprintf(stdout,"Version: %s\n",
00231             GetMagickVersion((unsigned long *) NULL));
00232           (void) fprintf(stdout,"Copyright: %s\n\n",GetMagickCopyright());
00233           return(MagickFalse);
00234         }
00235     }
00236   if (argc < 3)
00237     StreamUsage();
00238   format="%w,%h,%m";
00239   j=1;
00240   k=0;
00241   NewImageStack();
00242   option=(char *) NULL;
00243   pend=MagickFalse;
00244   stream_info=AcquireStreamInfo(image_info);
00245   status=MagickTrue;
00246   /*
00247     Stream an image.
00248   */
00249   ReadCommandlLine(argc,&argv);
00250   status=ExpandFilenames(&argc,&argv);
00251   if (status == MagickFalse)
00252     ThrowStreamException(ResourceLimitError,"MemoryAllocationFailed",
00253       strerror(errno));
00254   status=OpenStream(image_info,stream_info,argv[argc-1],exception);
00255   if (status == MagickFalse)
00256     {
00257       DestroyStream();
00258       return(MagickFalse);
00259     }
00260   for (i=1; i < (long) (argc-1); i++)
00261   {
00262     option=argv[i];
00263     if (LocaleCompare(option,"(") == 0)
00264       {
00265         FireImageStack(MagickFalse,MagickTrue,pend);
00266         if (k == MaxImageStackDepth)
00267           ThrowStreamException(OptionError,"ParenthesisNestedTooDeeply",option);
00268         PushImageStack();
00269         continue;
00270       }
00271     if (LocaleCompare(option,")") == 0)
00272       {
00273         FireImageStack(MagickFalse,MagickTrue,MagickTrue);
00274         if (k == 0)
00275           ThrowStreamException(OptionError,"UnableToParseExpression",option);
00276         PopImageStack();
00277         continue;
00278       }
00279     if (IsMagickOption(option) == MagickFalse)
00280       {
00281         Image
00282           *images;
00283 
00284         /*
00285           Stream input image.
00286         */
00287         FireImageStack(MagickFalse,MagickTrue,pend);
00288         filename=argv[i];
00289         if ((LocaleCompare(filename,"--") == 0) && (i < (argc-1)))
00290           filename=argv[++i];
00291         (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
00292         images=StreamImage(image_info,stream_info,exception);
00293         status&=(images != (Image *) NULL) &&
00294           (exception->severity < ErrorException);
00295         if (images == (Image *) NULL)
00296           continue;
00297         AppendImageStack(images);
00298         continue;
00299       }
00300     pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
00301     switch (*(option+1))
00302     {
00303       case 'a':
00304       {
00305         if (LocaleCompare("authenticate",option+1) == 0)
00306           {
00307             if (*option == '+')
00308               break;
00309             i++;
00310             if (i == (long) (argc-1))
00311               ThrowStreamException(OptionError,"MissingArgument",option);
00312             break;
00313           }
00314         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00315       }
00316       case 'c':
00317       {
00318         if (LocaleCompare("cache",option+1) == 0)
00319           {
00320             if (*option == '+')
00321               break;
00322             i++;
00323             if (i == (long) argc)
00324               ThrowStreamException(OptionError,"MissingArgument",option);
00325             if (IsGeometry(argv[i]) == MagickFalse)
00326               ThrowStreamInvalidArgumentException(option,argv[i]);
00327             break;
00328           }
00329         if (LocaleCompare("channel",option+1) == 0)
00330           {
00331             long
00332               channel;
00333 
00334             if (*option == '+')
00335               break;
00336             i++;
00337             if (i == (long) (argc-1))
00338               ThrowStreamException(OptionError,"MissingArgument",option);
00339             channel=ParseChannelOption(argv[i]);
00340             if (channel < 0)
00341               ThrowStreamException(OptionError,"UnrecognizedChannelType",
00342                 argv[i]);
00343             break;
00344           }
00345         if (LocaleCompare("colorspace",option+1) == 0)
00346           {
00347             long
00348               colorspace;
00349 
00350             if (*option == '+')
00351               break;
00352             i++;
00353             if (i == (long) (argc-1))
00354               ThrowStreamException(OptionError,"MissingArgument",option);
00355             colorspace=ParseMagickOption(MagickColorspaceOptions,MagickFalse,
00356               argv[i]);
00357             if (colorspace < 0)
00358               ThrowStreamException(OptionError,"UnrecognizedColorspace",
00359                 argv[i]);
00360             break;
00361           }
00362         if (LocaleCompare("compress",option+1) == 0)
00363           {
00364             long
00365               compress;
00366 
00367             if (*option == '+')
00368               break;
00369             i++;
00370             if (i == (long) (argc-1))
00371               ThrowStreamException(OptionError,"MissingArgument",option);
00372             compress=ParseMagickOption(MagickCompressOptions,MagickFalse,
00373               argv[i]);
00374             if (compress < 0)
00375               ThrowStreamException(OptionError,"UnrecognizedImageCompression",
00376                 argv[i]);
00377             break;
00378           }
00379         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00380       }
00381       case 'd':
00382       {
00383         if (LocaleCompare("debug",option+1) == 0)
00384           {
00385             long
00386               event;
00387 
00388             if (*option == '+')
00389               break;
00390             i++;
00391             if (i == (long) argc)
00392               ThrowStreamException(OptionError,"MissingArgument",option);
00393             event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
00394             if (event < 0)
00395               ThrowStreamException(OptionError,"UnrecognizedEventType",argv[i]);
00396             (void) SetLogEventMask(argv[i]);
00397             break;
00398             break;
00399           }
00400         if (LocaleCompare("define",option+1) == 0)
00401           {
00402             i++;
00403             if (i == (long) argc)
00404               ThrowStreamException(OptionError,"MissingArgument",option);
00405             if (*option == '+')
00406               {
00407                 const char
00408                   *define;
00409 
00410                 define=GetImageOption(image_info,argv[i]);
00411                 if (define == (const char *) NULL)
00412                   ThrowStreamException(OptionError,"NoSuchOption",argv[i]);
00413                 break;
00414               }
00415             break;
00416           }
00417         if (LocaleCompare("density",option+1) == 0)
00418           {
00419             if (*option == '+')
00420               break;
00421             i++;
00422             if (i == (long) argc)
00423               ThrowStreamException(OptionError,"MissingArgument",option);
00424             if (IsGeometry(argv[i]) == MagickFalse)
00425               ThrowStreamInvalidArgumentException(option,argv[i]);
00426             break;
00427           }
00428         if (LocaleCompare("depth",option+1) == 0)
00429           {
00430             if (*option == '+')
00431               break;
00432             i++;
00433             if (i == (long) argc)
00434               ThrowStreamException(OptionError,"MissingArgument",option);
00435             if (IsGeometry(argv[i]) == MagickFalse)
00436               ThrowStreamInvalidArgumentException(option,argv[i]);
00437             break;
00438           }
00439         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00440       }
00441       case 'e':
00442       {
00443         if (LocaleCompare("extract",option+1) == 0)
00444           {
00445             if (*option == '+')
00446               break;
00447             i++;
00448             if (i == (long) (argc-1))
00449               ThrowStreamException(OptionError,"MissingArgument",option);
00450             if (IsGeometry(argv[i]) == MagickFalse)
00451               ThrowStreamInvalidArgumentException(option,argv[i]);
00452             break;
00453           }
00454         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00455       }
00456       case 'h':
00457       {
00458         if ((LocaleCompare("help",option+1) == 0) ||
00459             (LocaleCompare("-help",option+1) == 0))
00460           StreamUsage();
00461         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00462       }
00463       case 'i':
00464       {
00465         if (LocaleCompare("identify",option+1) == 0)
00466           break;
00467         if (LocaleCompare("interlace",option+1) == 0)
00468           {
00469             long
00470               interlace;
00471 
00472             if (*option == '+')
00473               break;
00474             i++;
00475             if (i == (long) argc)
00476               ThrowStreamException(OptionError,"MissingArgument",option);
00477             interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
00478               argv[i]);
00479             if (interlace < 0)
00480               ThrowStreamException(OptionError,"UnrecognizedInterlaceType",
00481                 argv[i]);
00482             break;
00483           }
00484         if (LocaleCompare("interpolate",option+1) == 0)
00485           {
00486             long
00487               interpolate;
00488 
00489             if (*option == '+')
00490               break;
00491             i++;
00492             if (i == (long) argc)
00493               ThrowStreamException(OptionError,"MissingArgument",option);
00494             interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
00495               argv[i]);
00496             if (interpolate < 0)
00497               ThrowStreamException(OptionError,"UnrecognizedInterpolateMethod",
00498                 argv[i]);
00499             break;
00500           }
00501         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00502       }
00503       case 'l':
00504       {
00505         if (LocaleCompare("limit",option+1) == 0)
00506           {
00507             char
00508               *p;
00509 
00510             long
00511               resource;
00512 
00513             if (*option == '+')
00514               break;
00515             i++;
00516             if (i == (long) argc)
00517               ThrowStreamException(OptionError,"MissingArgument",option);
00518             resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
00519               argv[i]);
00520             if (resource < 0)
00521               ThrowStreamException(OptionError,"UnrecognizedResourceType",
00522                 argv[i]);
00523             i++;
00524             if (i == (long) argc)
00525               ThrowStreamException(OptionError,"MissingArgument",option);
00526             (void) strtod(argv[i],&p);
00527             if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
00528               ThrowStreamInvalidArgumentException(option,argv[i]);
00529             break;
00530           }
00531         if (LocaleCompare("log",option+1) == 0)
00532           {
00533             if (*option == '+')
00534               break;
00535             i++;
00536             if ((i == (long) argc) || (strchr(argv[i],'%') == (char *) NULL))
00537               ThrowStreamException(OptionError,"MissingArgument",option);
00538             break;
00539           }
00540         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00541       }
00542       case 'm':
00543       {
00544         if (LocaleCompare("map",option+1) == 0)
00545           {
00546             (void) CopyMagickString(argv[i]+1,"san",MaxTextExtent);
00547             if (*option == '+')
00548               break;
00549             i++;
00550             SetStreamInfoMap(stream_info,argv[i]);
00551             break;
00552           }
00553         if (LocaleCompare("monitor",option+1) == 0)
00554           break;
00555         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00556       }
00557       case 'q':
00558       {
00559         if (LocaleCompare("quantize",option+1) == 0)
00560           {
00561             long
00562               colorspace;
00563 
00564             if (*option == '+')
00565               break;
00566             i++;
00567             if (i == (long) (argc-1))
00568               ThrowStreamException(OptionError,"MissingArgument",option);
00569             colorspace=ParseMagickOption(MagickColorspaceOptions,
00570               MagickFalse,argv[i]);
00571             if (colorspace < 0)
00572               ThrowStreamException(OptionError,"UnrecognizedColorspace",
00573                 argv[i]);
00574             break;
00575           }
00576         if (LocaleCompare("quiet",option+1) == 0)
00577           break;
00578         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00579       }
00580       case 'r':
00581       {
00582         if (LocaleCompare("regard-warnings",option+1) == 0)
00583           break;
00584         if (LocaleCompare("respect-parenthesis",option+1) == 0)
00585           {
00586             respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
00587             break;
00588           }
00589         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00590       }
00591       case 's':
00592       {
00593         if (LocaleCompare("sampling-factor",option+1) == 0)
00594           {
00595             if (*option == '+')
00596               break;
00597             i++;
00598             if (i == (long) argc)
00599               ThrowStreamException(OptionError,"MissingArgument",option);
00600             if (IsGeometry(argv[i]) == MagickFalse)
00601               ThrowStreamInvalidArgumentException(option,argv[i]);
00602             break;
00603           }
00604         if (LocaleCompare("seed",option+1) == 0)
00605           {
00606             if (*option == '+')
00607               break;
00608             i++;
00609             if (i == (long) (argc-1))
00610               ThrowStreamException(OptionError,"MissingArgument",option);
00611             if (IsGeometry(argv[i]) == MagickFalse)
00612               ThrowStreamInvalidArgumentException(option,argv[i]);
00613             break;
00614           }
00615         if (LocaleCompare("set",option+1) == 0)
00616           {
00617             i++;
00618             if (i == (long) argc)
00619               ThrowStreamException(OptionError,"MissingArgument",option);
00620             if (*option == '+')
00621               break;
00622             i++;
00623             if (i == (long) argc)
00624               ThrowStreamException(OptionError,"MissingArgument",option);
00625             break;
00626           }
00627         if (LocaleCompare("size",option+1) == 0)
00628           {
00629             if (*option == '+')
00630               break;
00631             i++;
00632             if (i == (long) argc)
00633               ThrowStreamException(OptionError,"MissingArgument",option);
00634             if (IsGeometry(argv[i]) == MagickFalse)
00635               ThrowStreamInvalidArgumentException(option,argv[i]);
00636             break;
00637           }
00638         if (LocaleCompare("storage-type",option+1) == 0)
00639           {
00640             long
00641               type;
00642 
00643             if (*option == '+')
00644               break;
00645             i++;
00646             if (i == (long) (argc-1))
00647               ThrowStreamException(OptionError,"MissingArgument",option);
00648             type=ParseMagickOption(MagickStorageOptions,MagickFalse,argv[i]);
00649             if (type < 0)
00650               ThrowStreamException(OptionError,"UnrecognizedStorageType",
00651                 argv[i]);
00652             SetStreamInfoStorageType(stream_info,(StorageType) type);
00653             break;
00654           }
00655         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00656       }
00657       case 't':
00658       {
00659         if (LocaleCompare("transparent-color",option+1) == 0)
00660           {
00661             if (*option == '+')
00662               break;
00663             i++;
00664             if (i == (long) (argc-1))
00665               ThrowStreamException(OptionError,"MissingArgument",option);
00666             break;
00667           }
00668         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00669       }
00670       case 'v':
00671       {
00672         if (LocaleCompare("verbose",option+1) == 0)
00673           break;
00674         if ((LocaleCompare("version",option+1) == 0) ||
00675             (LocaleCompare("-version",option+1) == 0))
00676           {
00677             (void) fprintf(stdout,"Version: %s\n",
00678               GetMagickVersion((unsigned long *) NULL));
00679             (void) fprintf(stdout,"Copyright: %s\n\n",GetMagickCopyright());
00680             break;
00681           }
00682         if (LocaleCompare("virtual-pixel",option+1) == 0)
00683           {
00684             long
00685               method;
00686 
00687             if (*option == '+')
00688               break;
00689             i++;
00690             if (i == (long) (argc-1))
00691               ThrowStreamException(OptionError,"MissingArgument",option);
00692             method=ParseMagickOption(MagickVirtualPixelOptions,MagickFalse,
00693               argv[i]);
00694             if (method < 0)
00695               ThrowStreamException(OptionError,
00696                 "UnrecognizedVirtualPixelMethod",argv[i]);
00697             break;
00698           }
00699         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00700       }
00701       case '?':
00702         break;
00703       default:
00704         ThrowStreamException(OptionError,"UnrecognizedOption",option)
00705     }
00706     fire=ParseMagickOption(MagickImageListOptions,MagickFalse,option+1) < 0 ? 
00707       MagickFalse : MagickTrue;
00708     if (fire != MagickFalse)
00709       FireImageStack(MagickFalse,MagickTrue,MagickTrue);
00710   }
00711   if (k != 0)
00712     ThrowStreamException(OptionError,"UnbalancedParenthesis",argv[i]);
00713   if (i-- != (long) (argc-1))
00714     ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
00715   if (image == (Image *) NULL)
00716     ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
00717   FinalizeImageSettings(image_info,image);
00718   DestroyStream();
00719   return(status != 0 ? MagickTrue : MagickFalse);
00720 }

Generated on Sat Nov 22 23:45:26 2008 for MagickWand by  doxygen 1.5.7.1