2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 % Render Text Onto A Canvas Image. %
20 % Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
26 % https://www.imagemagick.org/script/license.php %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 #include "MagickCore/studio.h"
43 #include "MagickCore/annotate.h"
44 #include "MagickCore/attribute.h"
45 #include "MagickCore/blob.h"
46 #include "MagickCore/blob-private.h"
47 #include "MagickCore/cache.h"
48 #include "MagickCore/color.h"
49 #include "MagickCore/color-private.h"
50 #include "MagickCore/colorspace.h"
51 #include "MagickCore/constitute.h"
52 #include "MagickCore/draw.h"
53 #include "MagickCore/exception.h"
54 #include "MagickCore/exception-private.h"
55 #include "MagickCore/geometry.h"
56 #include "MagickCore/image.h"
57 #include "MagickCore/image-private.h"
58 #include "MagickCore/list.h"
59 #include "MagickCore/magick.h"
60 #include "MagickCore/memory_.h"
61 #include "MagickCore/monitor.h"
62 #include "MagickCore/monitor-private.h"
63 #include "MagickCore/option.h"
64 #include "MagickCore/pixel-accessor.h"
65 #include "MagickCore/quantum-private.h"
66 #include "MagickCore/static.h"
67 #include "MagickCore/statistic.h"
68 #include "MagickCore/string_.h"
69 #include "MagickCore/module.h"
74 static MagickBooleanType
75 WriteTXTImage(const ImageInfo *,Image *,ExceptionInfo *);
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 % IsTXT() returns MagickTrue if the image format type, identified by the magick
91 % The format of the IsTXT method is:
93 % MagickBooleanType IsTXT(const unsigned char *magick,const size_t length)
95 % A description of each parameter follows:
97 % o magick: compare image format pattern against these bytes.
99 % o length: Specifies the length of the magick string.
102 static MagickBooleanType IsTXT(const unsigned char *magick,const size_t length)
104 #define MagickID "# ImageMagick pixel enumeration:"
107 colorspace[MagickPathExtent];
119 if (LocaleNCompare((const char *) magick,MagickID,strlen(MagickID)) != 0)
121 count=(ssize_t) sscanf((const char *) magick+32,"%lu,%lu,%lu,%s",&columns,
122 &rows,&depth,colorspace);
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 % R e a d T E X T I m a g e %
137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139 % ReadTEXTImage() reads a text file and returns it as an image. It
140 % allocates the memory necessary for the new Image structure and returns a
141 % pointer to the new image.
143 % The format of the ReadTEXTImage method is:
145 % Image *ReadTEXTImage(const ImageInfo *image_info,Image *image,
146 % char *text,ExceptionInfo *exception)
148 % A description of each parameter follows:
150 % o image_info: the image info.
152 % o image: the image.
154 % o text: the text storage buffer.
156 % o exception: return any errors or warnings in this structure.
159 static Image *ReadTEXTImage(const ImageInfo *image_info,
160 ExceptionInfo *exception)
163 filename[MagickPathExtent],
164 geometry[MagickPathExtent],
166 text[MagickPathExtent];
193 assert(image_info != (const ImageInfo *) NULL);
194 assert(image_info->signature == MagickCoreSignature);
195 if (image_info->debug != MagickFalse)
196 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
197 image_info->filename);
198 assert(exception != (ExceptionInfo *) NULL);
199 assert(exception->signature == MagickCoreSignature);
200 image=AcquireImage(image_info,exception);
201 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
202 if (status == MagickFalse)
204 image=DestroyImageList(image);
205 return((Image *) NULL);
207 (void) ResetMagickMemory(text,0,sizeof(text));
208 (void) ReadBlobString(image,text);
210 Set the page geometry.
212 delta.x=DefaultResolution;
213 delta.y=DefaultResolution;
214 if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0))
222 flags=ParseGeometry(PSDensityGeometry,&geometry_info);
223 image->resolution.x=geometry_info.rho;
224 image->resolution.y=geometry_info.sigma;
225 if ((flags & SigmaValue) == 0)
226 image->resolution.y=image->resolution.x;
232 if (image_info->page != (char *) NULL)
233 (void) ParseAbsoluteGeometry(image_info->page,&page);
235 Initialize Image structure.
237 image->columns=(size_t) floor((((double) page.width*image->resolution.x)/
239 image->rows=(size_t) floor((((double) page.height*image->resolution.y)/
241 status=SetImageExtent(image,image->columns,image->rows,exception);
242 if (status == MagickFalse)
243 return(DestroyImageList(image));
246 texture=(Image *) NULL;
247 if (image_info->texture != (char *) NULL)
252 read_info=CloneImageInfo(image_info);
253 SetImageInfoBlob(read_info,(void *) NULL,0);
254 (void) CopyMagickString(read_info->filename,image_info->texture,
256 texture=ReadImage(read_info,exception);
257 read_info=DestroyImageInfo(read_info);
260 Annotate the text image.
262 (void) SetImageBackgroundColor(image,exception);
263 draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
264 (void) CloneString(&draw_info->text,image_info->filename);
265 (void) FormatLocaleString(geometry,MagickPathExtent,"%gx%g%+g%+g",(double)
266 image->columns,(double) image->rows,(double) page.x,(double) page.y);
267 (void) CloneString(&draw_info->geometry,geometry);
268 status=GetTypeMetrics(image,draw_info,&metrics,exception);
269 if (status == MagickFalse)
270 ThrowReaderException(TypeError,"UnableToGetTypeMetrics");
271 page.y=(ssize_t) ceil((double) page.y+metrics.ascent-0.5);
272 (void) FormatLocaleString(geometry,MagickPathExtent,"%gx%g%+g%+g",(double)
273 image->columns,(double) image->rows,(double) page.x,(double) page.y);
274 (void) CloneString(&draw_info->geometry,geometry);
275 (void) CopyMagickString(filename,image_info->filename,MagickPathExtent);
276 if (*draw_info->text != '\0')
277 *draw_info->text='\0';
279 for (offset=2*page.y; p != (char *) NULL; )
282 Annotate image with text.
284 (void) ConcatenateString(&draw_info->text,text);
285 (void) ConcatenateString(&draw_info->text,"\n");
286 offset+=(ssize_t) (metrics.ascent-metrics.descent);
287 if (image->previous == (Image *) NULL)
289 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) offset,
291 if (status == MagickFalse)
294 p=ReadBlobString(image,text);
295 if ((offset < (ssize_t) image->rows) && (p != (char *) NULL))
297 if (texture != (Image *) NULL)
299 MagickProgressMonitor
302 progress_monitor=SetImageProgressMonitor(image,
303 (MagickProgressMonitor) NULL,image->client_data);
304 (void) TextureImage(image,texture,exception);
305 (void) SetImageProgressMonitor(image,progress_monitor,
308 (void) AnnotateImage(image,draw_info,exception);
309 if (p == (char *) NULL)
312 Page is full-- allocate next image structure.
314 *draw_info->text='\0';
316 AcquireNextImage(image_info,image,exception);
317 if (GetNextImageInList(image) == (Image *) NULL)
319 image=DestroyImageList(image);
320 return((Image *) NULL);
322 image->next->columns=image->columns;
323 image->next->rows=image->rows;
324 image=SyncNextImageInList(image);
325 (void) CopyMagickString(image->filename,filename,MagickPathExtent);
326 (void) SetImageBackgroundColor(image,exception);
327 status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
329 if (status == MagickFalse)
332 if (texture != (Image *) NULL)
334 MagickProgressMonitor
337 progress_monitor=SetImageProgressMonitor(image,
338 (MagickProgressMonitor) NULL,image->client_data);
339 (void) TextureImage(image,texture,exception);
340 (void) SetImageProgressMonitor(image,progress_monitor,image->client_data);
342 (void) AnnotateImage(image,draw_info,exception);
343 if (texture != (Image *) NULL)
344 texture=DestroyImage(texture);
345 draw_info=DestroyDrawInfo(draw_info);
346 (void) CloseBlob(image);
347 return(GetFirstImageInList(image));
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355 % R e a d T X T I m a g e %
359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
361 % ReadTXTImage() reads a text file and returns it as an image. It allocates
362 % the memory necessary for the new Image structure and returns a pointer to
365 % The format of the ReadTXTImage method is:
367 % Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
369 % A description of each parameter follows:
371 % o image_info: the image info.
373 % o exception: return any errors or warnings in this structure.
376 static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
379 colorspace[MagickPathExtent],
380 text[MagickPathExtent];
419 assert(image_info != (const ImageInfo *) NULL);
420 assert(image_info->signature == MagickCoreSignature);
421 if (image_info->debug != MagickFalse)
422 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
423 image_info->filename);
424 assert(exception != (ExceptionInfo *) NULL);
425 assert(exception->signature == MagickCoreSignature);
426 image=AcquireImage(image_info,exception);
427 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
428 if (status == MagickFalse)
430 image=DestroyImageList(image);
431 return((Image *) NULL);
433 (void) ResetMagickMemory(text,0,sizeof(text));
434 (void) ReadBlobString(image,text);
435 if (LocaleNCompare((char *) text,MagickID,strlen(MagickID)) != 0)
436 ThrowReaderException(CorruptImageError,"ImproperImageHeader");
443 count=(ssize_t) sscanf(text+32,"%lu,%lu,%lu,%s",&width,&height,&max_value,
445 if ((count != 4) || (width == 0) || (height == 0) || (max_value == 0))
446 ThrowReaderException(CorruptImageError,"ImproperImageHeader");
447 image->columns=width;
449 for (depth=1; (GetQuantumRange(depth)+1) < max_value; depth++) ;
451 status=SetImageExtent(image,image->columns,image->rows,exception);
452 if (status == MagickFalse)
453 return(DestroyImageList(image));
454 LocaleLower(colorspace);
455 i=(ssize_t) strlen(colorspace)-1;
456 image->alpha_trait=UndefinedPixelTrait;
457 if ((i > 0) && (colorspace[i] == 'a'))
460 image->alpha_trait=BlendPixelTrait;
462 type=ParseCommandOption(MagickColorspaceOptions,MagickFalse,colorspace);
464 ThrowReaderException(CorruptImageError,"ImproperImageHeader");
465 (void) SetImageBackgroundColor(image,exception);
466 (void) SetImageColorspace(image,(ColorspaceType) type,exception);
467 GetPixelInfo(image,&pixel);
468 range=GetQuantumRange(image->depth);
469 for (y=0; y < (ssize_t) image->rows; y++)
483 for (x=0; x < (ssize_t) image->columns; x++)
485 if (ReadBlobString(image,text) == (char *) NULL)
487 switch (image->colorspace)
491 if (image->alpha_trait != UndefinedPixelTrait)
493 count=(ssize_t) sscanf(text,"%ld,%ld: (%lf%*[%,]%lf%*[%,]",
494 &x_offset,&y_offset,&red,&alpha);
499 count=(ssize_t) sscanf(text,"%ld,%ld: (%lf%*[%,]",&x_offset,
507 if (image->alpha_trait != UndefinedPixelTrait)
509 count=(ssize_t) sscanf(text,
510 "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
511 &x_offset,&y_offset,&red,&green,&blue,&black,&alpha);
514 count=(ssize_t) sscanf(text,
515 "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",&x_offset,
516 &y_offset,&red,&green,&blue,&black);
521 if (image->alpha_trait != UndefinedPixelTrait)
523 count=(ssize_t) sscanf(text,
524 "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
525 &x_offset,&y_offset,&red,&green,&blue,&alpha);
528 count=(ssize_t) sscanf(text,
529 "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]",&x_offset,
530 &y_offset,&red,&green,&blue);
534 if (strchr(text,'%') != (char *) NULL)
542 if (image->colorspace == LabColorspace)
544 green+=(range+1)/2.0;
547 pixel.red=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (red+0.5),
549 pixel.green=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (green+0.5),
551 pixel.blue=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (blue+0.5),
553 pixel.black=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (black+0.5),
555 pixel.alpha=(MagickRealType) ScaleAnyToQuantum((QuantumAny) (alpha+0.5),
557 q=GetAuthenticPixels(image,(ssize_t) x_offset,(ssize_t) y_offset,1,1,
559 if (q == (Quantum *) NULL)
561 SetPixelViaPixelInfo(image,&pixel,q);
562 if (SyncAuthenticPixels(image,exception) == MagickFalse)
566 if (EOFBlob(image) != MagickFalse)
568 ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
572 (void) ReadBlobString(image,text);
573 if (LocaleNCompare((char *) text,MagickID,strlen(MagickID)) == 0)
576 Allocate next image structure.
578 AcquireNextImage(image_info,image,exception);
579 if (GetNextImageInList(image) == (Image *) NULL)
581 image=DestroyImageList(image);
582 return((Image *) NULL);
584 image=SyncNextImageInList(image);
585 status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
587 if (status == MagickFalse)
590 } while (LocaleNCompare((char *) text,MagickID,strlen(MagickID)) == 0);
591 (void) CloseBlob(image);
592 return(GetFirstImageInList(image));
596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
600 % R e g i s t e r T X T I m a g e %
604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
606 % RegisterTXTImage() adds attributes for the TXT image format to the
607 % list of supported formats. The attributes include the image format
608 % tag, a method to read and/or write the format, whether the format
609 % supports the saving of more than one frame to the same file or blob,
610 % whether the format supports native in-memory I/O, and a brief
611 % description of the format.
613 % The format of the RegisterTXTImage method is:
615 % size_t RegisterTXTImage(void)
618 ModuleExport size_t RegisterTXTImage(void)
623 entry=AcquireMagickInfo("TXT","SPARSE-COLOR","Sparse Color");
624 entry->encoder=(EncodeImageHandler *) WriteTXTImage;
625 entry->flags|=CoderRawSupportFlag;
626 entry->flags|=CoderEndianSupportFlag;
627 (void) RegisterMagickInfo(entry);
628 entry=AcquireMagickInfo("TXT","TEXT","Text");
629 entry->decoder=(DecodeImageHandler *) ReadTEXTImage;
630 entry->format_type=ImplicitFormatType;
631 entry->flags|=CoderRawSupportFlag;
632 entry->flags|=CoderEndianSupportFlag;
633 (void) RegisterMagickInfo(entry);
634 entry=AcquireMagickInfo("TXT","TXT","Text");
635 entry->decoder=(DecodeImageHandler *) ReadTXTImage;
636 entry->encoder=(EncodeImageHandler *) WriteTXTImage;
637 entry->magick=(IsImageFormatHandler *) IsTXT;
638 (void) RegisterMagickInfo(entry);
639 return(MagickImageCoderSignature);
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
647 % U n r e g i s t e r T X T I m a g e %
651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
653 % UnregisterTXTImage() removes format registrations made by the
654 % TXT module from the list of supported format.
656 % The format of the UnregisterTXTImage method is:
658 % UnregisterTXTImage(void)
661 ModuleExport void UnregisterTXTImage(void)
663 (void) UnregisterMagickInfo("SPARSE-COLOR");
664 (void) UnregisterMagickInfo("TEXT");
665 (void) UnregisterMagickInfo("TXT");
669 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
673 % W r i t e T X T I m a g e %
677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
679 % WriteTXTImage writes the pixel values as text numbers.
681 % The format of the WriteTXTImage method is:
683 % MagickBooleanType WriteTXTImage(const ImageInfo *image_info,
684 % Image *image,ExceptionInfo *exception)
686 % A description of each parameter follows.
688 % o image_info: the image info.
690 % o image: The image.
692 % o exception: return any errors or warnings in this structure.
695 static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
696 ExceptionInfo *exception)
699 buffer[MagickPathExtent],
700 colorspace[MagickPathExtent],
701 tuple[MagickPathExtent];
712 register const Quantum
722 Open output image file.
724 assert(image_info != (const ImageInfo *) NULL);
725 assert(image_info->signature == MagickCoreSignature);
726 assert(image != (Image *) NULL);
727 assert(image->signature == MagickCoreSignature);
728 if (image->debug != MagickFalse)
729 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
730 status=OpenBlob(image_info,image,WriteBlobMode,exception);
731 if (status == MagickFalse)
742 (void) CopyMagickString(colorspace,CommandOptionToMnemonic(
743 MagickColorspaceOptions,(ssize_t) image->colorspace),MagickPathExtent);
744 LocaleLower(colorspace);
745 image->depth=GetImageQuantumDepth(image,MagickTrue);
746 if (image->alpha_trait != UndefinedPixelTrait)
747 (void) ConcatenateMagickString(colorspace,"a",MagickPathExtent);
748 compliance=NoCompliance;
749 value=GetImageOption(image_info,"txt:compliance");
750 if (value != (char *) NULL)
751 compliance=(ComplianceType) ParseCommandOption(MagickComplianceOptions,
753 if (LocaleCompare(image_info->magick,"SPARSE-COLOR") != 0)
758 depth=compliance == SVGCompliance ? image->depth :
759 MAGICKCORE_QUANTUM_DEPTH;
760 (void) FormatLocaleString(buffer,MagickPathExtent,
761 "# ImageMagick pixel enumeration: %.20g,%.20g,%.20g,%s\n",(double)
762 image->columns,(double) image->rows,(double) ((MagickOffsetType)
763 GetQuantumRange(depth)),colorspace);
764 (void) WriteBlobString(image,buffer);
766 GetPixelInfo(image,&pixel);
767 for (y=0; y < (ssize_t) image->rows; y++)
769 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
770 if (p == (const Quantum *) NULL)
772 for (x=0; x < (ssize_t) image->columns; x++)
774 GetPixelInfoPixel(image,p,&pixel);
775 if (pixel.colorspace == LabColorspace)
777 pixel.green-=(QuantumRange+1)/2.0;
778 pixel.blue-=(QuantumRange+1)/2.0;
780 if (LocaleCompare(image_info->magick,"SPARSE-COLOR") == 0)
785 if (GetPixelAlpha(image,p) == (Quantum) OpaqueAlpha)
787 GetColorTuple(&pixel,MagickFalse,tuple);
788 (void) FormatLocaleString(buffer,MagickPathExtent,
789 "%.20g,%.20g,",(double) x,(double) y);
790 (void) WriteBlobString(image,buffer);
791 (void) WriteBlobString(image,tuple);
792 (void) WriteBlobString(image," ");
794 p+=GetPixelChannels(image);
797 (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g,%.20g: ",
798 (double) x,(double) y);
799 (void) WriteBlobString(image,buffer);
800 (void) CopyMagickString(tuple,"(",MagickPathExtent);
801 if (pixel.colorspace == GRAYColorspace)
802 ConcatenateColorComponent(&pixel,GrayPixelChannel,compliance,tuple);
805 ConcatenateColorComponent(&pixel,RedPixelChannel,compliance,tuple);
806 (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
807 ConcatenateColorComponent(&pixel,GreenPixelChannel,compliance,
809 (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
810 ConcatenateColorComponent(&pixel,BluePixelChannel,compliance,tuple);
812 if (pixel.colorspace == CMYKColorspace)
814 (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
815 ConcatenateColorComponent(&pixel,BlackPixelChannel,compliance,
818 if (pixel.alpha_trait != UndefinedPixelTrait)
820 (void) ConcatenateMagickString(tuple,",",MagickPathExtent);
821 ConcatenateColorComponent(&pixel,AlphaPixelChannel,compliance,
824 (void) ConcatenateMagickString(tuple,")",MagickPathExtent);
825 (void) WriteBlobString(image,tuple);
826 (void) WriteBlobString(image," ");
827 GetColorTuple(&pixel,MagickTrue,tuple);
828 (void) FormatLocaleString(buffer,MagickPathExtent,"%s",tuple);
829 (void) WriteBlobString(image,buffer);
830 (void) WriteBlobString(image," ");
831 (void) QueryColorname(image,&pixel,SVGCompliance,tuple,exception);
832 (void) WriteBlobString(image,tuple);
833 (void) WriteBlobString(image,"\n");
834 p+=GetPixelChannels(image);
836 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
838 if (status == MagickFalse)
841 if (GetNextImageInList(image) == (Image *) NULL)
843 image=SyncNextImageInList(image);
844 status=SetImageProgress(image,SaveImagesTag,scene++,
845 GetImageListLength(image));
846 if (status == MagickFalse)
848 } while (image_info->adjoin != MagickFalse);
849 (void) CloseBlob(image);