2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 % Read/Write Raw CCIR 601 4:1:1 or 4:2:2 Image Format %
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 % http://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/blob.h"
44 #include "MagickCore/blob-private.h"
45 #include "MagickCore/cache.h"
46 #include "MagickCore/colorspace.h"
47 #include "MagickCore/constitute.h"
48 #include "MagickCore/exception.h"
49 #include "MagickCore/exception-private.h"
50 #include "MagickCore/geometry.h"
51 #include "MagickCore/image.h"
52 #include "MagickCore/image-private.h"
53 #include "MagickCore/list.h"
54 #include "MagickCore/magick.h"
55 #include "MagickCore/memory_.h"
56 #include "MagickCore/monitor.h"
57 #include "MagickCore/monitor-private.h"
58 #include "MagickCore/pixel-accessor.h"
59 #include "MagickCore/resize.h"
60 #include "MagickCore/quantum-private.h"
61 #include "MagickCore/static.h"
62 #include "MagickCore/string_.h"
63 #include "MagickCore/module.h"
64 #include "MagickCore/utility.h"
69 static MagickBooleanType
70 WriteYUVImage(const ImageInfo *,Image *,ExceptionInfo *);
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % R e a d Y U V I m a g e %
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
83 % ReadYUVImage() reads an image with digital YUV (CCIR 601 4:1:1, plane
84 % or partition interlaced, or 4:2:2 plane, partition interlaced or
85 % noninterlaced) bytes and returns it. It allocates the memory necessary
86 % for the new Image structure and returns a pointer to the new image.
88 % The format of the ReadYUVImage method is:
90 % Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
92 % A description of each parameter follows:
94 % o image_info: the image info.
96 % o exception: return any errors or warnings in this structure.
99 static Image *ReadYUVImage(const ImageInfo *image_info,ExceptionInfo *exception)
112 register const Quantum
121 register unsigned char
135 Allocate image structure.
137 assert(image_info != (const ImageInfo *) NULL);
138 assert(image_info->signature == MagickCoreSignature);
139 if (image_info->debug != MagickFalse)
140 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
141 image_info->filename);
142 assert(exception != (ExceptionInfo *) NULL);
143 assert(exception->signature == MagickCoreSignature);
144 image=AcquireImage(image_info,exception);
145 if ((image->columns == 0) || (image->rows == 0))
146 ThrowReaderException(OptionError,"MustSpecifyImageSize");
147 status=SetImageExtent(image,image->columns,image->rows,exception);
148 if (status == MagickFalse)
149 return(DestroyImageList(image));
150 quantum=image->depth <= 8 ? 1 : 2;
151 interlace=image_info->interlace;
154 if (image_info->sampling_factor != (char *) NULL)
162 flags=ParseGeometry(image_info->sampling_factor,&geometry_info);
163 horizontal_factor=(ssize_t) geometry_info.rho;
164 vertical_factor=(ssize_t) geometry_info.sigma;
165 if ((flags & SigmaValue) == 0)
166 vertical_factor=horizontal_factor;
167 if ((horizontal_factor != 1) && (horizontal_factor != 2) &&
168 (vertical_factor != 1) && (vertical_factor != 2))
169 ThrowReaderException(CorruptImageError,"UnexpectedSamplingFactor");
171 if ((interlace == UndefinedInterlace) ||
172 ((interlace == NoInterlace) && (vertical_factor == 2)))
174 interlace=NoInterlace; /* CCIR 4:2:2 */
175 if (vertical_factor == 2)
176 interlace=PlaneInterlace; /* CCIR 4:1:1 */
178 if (interlace != PartitionInterlace)
183 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
184 if (status == MagickFalse)
186 image=DestroyImageList(image);
187 return((Image *) NULL);
189 if (DiscardBlobBytes(image,image->offset) == MagickFalse)
190 ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
194 Allocate memory for a scanline.
196 if (interlace == NoInterlace)
197 scanline=(unsigned char *) AcquireQuantumMemory((size_t) 2UL*
198 image->columns+2UL,quantum*sizeof(*scanline));
200 scanline=(unsigned char *) AcquireQuantumMemory(image->columns,
201 quantum*sizeof(*scanline));
202 if (scanline == (unsigned char *) NULL)
203 ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
206 chroma_image=CloneImage(image,(image->columns+horizontal_factor-1)/
207 horizontal_factor,(image->rows+vertical_factor-1)/vertical_factor,
208 MagickTrue,exception);
209 if (chroma_image == (Image *) NULL)
210 ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
212 Convert raster image to pixel packets.
214 if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
215 if (image->scene >= (image_info->scene+image_info->number_scenes-1))
217 status=SetImageExtent(image,image->columns,image->rows,exception);
218 if (status == MagickFalse)
219 return(DestroyImageList(image));
220 if (interlace == PartitionInterlace)
222 AppendImageFormat("Y",image->filename);
223 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
224 if (status == MagickFalse)
226 image=DestroyImageList(image);
227 return((Image *) NULL);
230 for (y=0; y < (ssize_t) image->rows; y++)
235 if (interlace == NoInterlace)
237 if ((y > 0) || (GetPreviousImageInList(image) == (Image *) NULL))
238 count=ReadBlob(image,(size_t) (2*quantum*image->columns),scanline);
240 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
241 if (q == (Quantum *) NULL)
243 chroma_pixels=QueueAuthenticPixels(chroma_image,0,y,
244 chroma_image->columns,1,exception);
245 if (chroma_pixels == (Quantum *) NULL)
247 for (x=0; x < (ssize_t) image->columns; x+=2)
249 SetPixelRed(image,0,chroma_pixels);
251 SetPixelGreen(image,ScaleCharToQuantum(*p++),chroma_pixels);
254 SetPixelGreen(image,ScaleShortToQuantum(((*p) << 8) | *(p+1)),
259 SetPixelRed(image,ScaleCharToQuantum(*p++),q);
262 SetPixelRed(image,ScaleShortToQuantum(((*p) << 8) | *(p+1)),q);
265 SetPixelGreen(image,0,q);
266 SetPixelBlue(image,0,q);
267 q+=GetPixelChannels(image);
268 SetPixelGreen(image,0,q);
269 SetPixelBlue(image,0,q);
271 SetPixelBlue(image,ScaleCharToQuantum(*p++),chroma_pixels);
274 SetPixelBlue(image,ScaleShortToQuantum(((*p) << 8) | *(p+1)),
279 SetPixelRed(image,ScaleCharToQuantum(*p++),q);
282 SetPixelRed(image,ScaleShortToQuantum(((*p) << 8) | *(p+1)),q);
286 q+=GetPixelChannels(image);
291 if ((y > 0) || (GetPreviousImageInList(image) == (Image *) NULL))
292 count=ReadBlob(image,(size_t) quantum*image->columns,scanline);
294 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
295 if (q == (Quantum *) NULL)
297 for (x=0; x < (ssize_t) image->columns; x++)
300 SetPixelRed(image,ScaleCharToQuantum(*p++),q);
303 SetPixelRed(image,ScaleShortToQuantum(((*p) << 8) | *(p+1)),q);
306 SetPixelGreen(image,0,q);
307 SetPixelBlue(image,0,q);
308 q+=GetPixelChannels(image);
311 if (SyncAuthenticPixels(image,exception) == MagickFalse)
313 if (interlace == NoInterlace)
314 if (SyncAuthenticPixels(chroma_image,exception) == MagickFalse)
316 if (image->previous == (Image *) NULL)
318 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
320 if (status == MagickFalse)
324 if (interlace == PartitionInterlace)
326 (void) CloseBlob(image);
327 AppendImageFormat("U",image->filename);
328 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
329 if (status == MagickFalse)
331 image=DestroyImageList(image);
332 return((Image *) NULL);
335 if (interlace != NoInterlace)
337 for (y=0; y < (ssize_t) chroma_image->rows; y++)
339 count=ReadBlob(image,(size_t) quantum*chroma_image->columns,scanline);
341 q=QueueAuthenticPixels(chroma_image,0,y,chroma_image->columns,1,
343 if (q == (Quantum *) NULL)
345 for (x=0; x < (ssize_t) chroma_image->columns; x++)
347 SetPixelRed(chroma_image,0,q);
349 SetPixelGreen(chroma_image,ScaleCharToQuantum(*p++),q);
352 SetPixelGreen(chroma_image,ScaleShortToQuantum(((*p) << 8) |
356 SetPixelBlue(chroma_image,0,q);
357 q+=GetPixelChannels(chroma_image);
359 if (SyncAuthenticPixels(chroma_image,exception) == MagickFalse)
362 if (interlace == PartitionInterlace)
364 (void) CloseBlob(image);
365 AppendImageFormat("V",image->filename);
366 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
367 if (status == MagickFalse)
369 image=DestroyImageList(image);
370 return((Image *) NULL);
373 for (y=0; y < (ssize_t) chroma_image->rows; y++)
375 count=ReadBlob(image,(size_t) quantum*chroma_image->columns,scanline);
377 q=GetAuthenticPixels(chroma_image,0,y,chroma_image->columns,1,
379 if (q == (Quantum *) NULL)
381 for (x=0; x < (ssize_t) chroma_image->columns; x++)
384 SetPixelBlue(chroma_image,ScaleCharToQuantum(*p++),q);
387 SetPixelBlue(chroma_image,ScaleShortToQuantum(((*p) << 8) |
391 q+=GetPixelChannels(chroma_image);
393 if (SyncAuthenticPixels(chroma_image,exception) == MagickFalse)
400 resize_image=ResizeImage(chroma_image,image->columns,image->rows,
401 TriangleFilter,exception);
402 chroma_image=DestroyImage(chroma_image);
403 if (resize_image == (Image *) NULL)
404 ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
405 for (y=0; y < (ssize_t) image->rows; y++)
407 q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
408 chroma_pixels=GetVirtualPixels(resize_image,0,y,resize_image->columns,1,
410 if ((q == (Quantum *) NULL) ||
411 (chroma_pixels == (const Quantum *) NULL))
413 for (x=0; x < (ssize_t) image->columns; x++)
415 SetPixelGreen(image,GetPixelGreen(image,chroma_pixels),q);
416 SetPixelBlue(image,GetPixelBlue(image,chroma_pixels),q);
418 q+=GetPixelChannels(image);
420 if (SyncAuthenticPixels(image,exception) == MagickFalse)
423 resize_image=DestroyImage(resize_image);
424 SetImageColorspace(image,YCbCrColorspace,exception);
425 if (interlace == PartitionInterlace)
426 (void) CopyMagickString(image->filename,image_info->filename,
428 if (EOFBlob(image) != MagickFalse)
430 ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
435 Proceed to next image.
437 if (image_info->number_scenes != 0)
438 if (image->scene >= (image_info->scene+image_info->number_scenes-1))
440 if (interlace == NoInterlace)
441 count=ReadBlob(image,(size_t) (2*quantum*image->columns),scanline);
443 count=ReadBlob(image,(size_t) quantum*image->columns,scanline);
447 Allocate next image structure.
449 AcquireNextImage(image_info,image,exception);
450 if (GetNextImageInList(image) == (Image *) NULL)
452 image=DestroyImageList(image);
453 return((Image *) NULL);
455 image=SyncNextImageInList(image);
456 status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
458 if (status == MagickFalse)
461 } while (count != 0);
462 scanline=(unsigned char *) RelinquishMagickMemory(scanline);
463 (void) CloseBlob(image);
464 return(GetFirstImageInList(image));
468 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472 % R e g i s t e r Y U V I m a g e %
476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
478 % RegisterYUVImage() adds attributes for the YUV image format to
479 % the list of supported formats. The attributes include the image format
480 % tag, a method to read and/or write the format, whether the format
481 % supports the saving of more than one frame to the same file or blob,
482 % whether the format supports native in-memory I/O, and a brief
483 % description of the format.
485 % The format of the RegisterYUVImage method is:
487 % size_t RegisterYUVImage(void)
490 ModuleExport size_t RegisterYUVImage(void)
495 entry=AcquireMagickInfo("YUV","YUV","CCIR 601 4:1:1 or 4:2:2");
496 entry->decoder=(DecodeImageHandler *) ReadYUVImage;
497 entry->encoder=(EncodeImageHandler *) WriteYUVImage;
498 entry->flags^=CoderAdjoinFlag;
499 entry->flags|=CoderRawSupportFlag;
500 (void) RegisterMagickInfo(entry);
501 return(MagickImageCoderSignature);
505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
509 % U n r e g i s t e r Y U V I m a g e %
513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515 % UnregisterYUVImage() removes format registrations made by the
516 % YUV module from the list of supported formats.
518 % The format of the UnregisterYUVImage method is:
520 % UnregisterYUVImage(void)
523 ModuleExport void UnregisterYUVImage(void)
525 (void) UnregisterMagickInfo("YUV");
529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 % W r i t e Y U V I m a g e %
537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
539 % WriteYUVImage() writes an image to a file in the digital YUV
540 % (CCIR 601 4:1:1, plane or partition interlaced, or 4:2:2 plane, partition
541 % interlaced or noninterlaced) bytes and returns it.
543 % The format of the WriteYUVImage method is:
545 % MagickBooleanType WriteYUVImage(const ImageInfo *image_info,
546 % Image *image,ExceptionInfo *exception)
548 % A description of each parameter follows.
550 % o image_info: the image info.
552 % o image: The image.
554 % o exception: return any errors or warnings in this structure.
557 static MagickBooleanType WriteYUVImage(const ImageInfo *image_info,Image *image,
558 ExceptionInfo *exception)
573 register const Quantum
590 assert(image_info != (const ImageInfo *) NULL);
591 assert(image_info->signature == MagickCoreSignature);
592 assert(image != (Image *) NULL);
593 assert(image->signature == MagickCoreSignature);
594 if (image->debug != MagickFalse)
595 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
596 quantum=(size_t) (image->depth <= 8 ? 1 : 2);
597 interlace=image->interlace;
600 if (image_info->sampling_factor != (char *) NULL)
608 flags=ParseGeometry(image_info->sampling_factor,&geometry_info);
609 horizontal_factor=(ssize_t) geometry_info.rho;
610 vertical_factor=(ssize_t) geometry_info.sigma;
611 if ((flags & SigmaValue) == 0)
612 vertical_factor=horizontal_factor;
613 if ((horizontal_factor != 1) && (horizontal_factor != 2) &&
614 (vertical_factor != 1) && (vertical_factor != 2))
615 ThrowWriterException(CorruptImageError,"UnexpectedSamplingFactor");
617 if ((interlace == UndefinedInterlace) ||
618 ((interlace == NoInterlace) && (vertical_factor == 2)))
620 interlace=NoInterlace; /* CCIR 4:2:2 */
621 if (vertical_factor == 2)
622 interlace=PlaneInterlace; /* CCIR 4:1:1 */
624 if (interlace != PartitionInterlace)
627 Open output image file.
629 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
630 if (status == MagickFalse)
635 AppendImageFormat("Y",image->filename);
636 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
637 if (status == MagickFalse)
644 Sample image to an even width and height, if necessary.
646 image->depth=(size_t) (quantum == 1 ? 8 : 16);
647 width=image->columns+(image->columns & (horizontal_factor-1));
648 height=image->rows+(image->rows & (vertical_factor-1));
649 yuv_image=ResizeImage(image,width,height,TriangleFilter,exception);
650 if (yuv_image == (Image *) NULL)
652 (void) CloseBlob(image);
655 (void) TransformImageColorspace(yuv_image,YCbCrColorspace,exception);
659 chroma_image=ResizeImage(image,width/horizontal_factor,
660 height/vertical_factor,TriangleFilter,exception);
661 if (chroma_image == (Image *) NULL)
663 (void) CloseBlob(image);
666 (void) TransformImageColorspace(chroma_image,YCbCrColorspace,exception);
667 if (interlace == NoInterlace)
670 Write noninterlaced YUV.
672 for (y=0; y < (ssize_t) yuv_image->rows; y++)
674 p=GetVirtualPixels(yuv_image,0,y,yuv_image->columns,1,exception);
675 if (p == (const Quantum *) NULL)
677 s=GetVirtualPixels(chroma_image,0,y,chroma_image->columns,1,
679 if (s == (const Quantum *) NULL)
681 for (x=0; x < (ssize_t) yuv_image->columns; x++)
685 (void) WriteBlobByte(image,ScaleQuantumToChar(
686 GetPixelGreen(yuv_image,s)));
687 (void) WriteBlobByte(image,ScaleQuantumToChar(
688 GetPixelRed(yuv_image,p)));
689 p+=GetPixelChannels(yuv_image);
690 (void) WriteBlobByte(image,ScaleQuantumToChar(
691 GetPixelBlue(yuv_image,s)));
692 (void) WriteBlobByte(image,ScaleQuantumToChar(
693 GetPixelRed(yuv_image,p)));
697 (void) WriteBlobByte(image,ScaleQuantumToChar(
698 GetPixelGreen(yuv_image,s)));
699 (void) WriteBlobShort(image,ScaleQuantumToShort(
700 GetPixelRed(yuv_image,p)));
701 p+=GetPixelChannels(yuv_image);
702 (void) WriteBlobByte(image,ScaleQuantumToChar(
703 GetPixelBlue(yuv_image,s)));
704 (void) WriteBlobShort(image,ScaleQuantumToShort(
705 GetPixelRed(yuv_image,p)));
707 p+=GetPixelChannels(yuv_image);
711 if (image->previous == (Image *) NULL)
713 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
715 if (status == MagickFalse)
719 yuv_image=DestroyImage(yuv_image);
724 Initialize Y channel.
726 for (y=0; y < (ssize_t) yuv_image->rows; y++)
728 p=GetVirtualPixels(yuv_image,0,y,yuv_image->columns,1,exception);
729 if (p == (const Quantum *) NULL)
731 for (x=0; x < (ssize_t) yuv_image->columns; x++)
734 (void) WriteBlobByte(image,ScaleQuantumToChar(
735 GetPixelRed(yuv_image,p)));
737 (void) WriteBlobShort(image,ScaleQuantumToShort(
738 GetPixelRed(yuv_image,p)));
739 p+=GetPixelChannels(yuv_image);
741 if (image->previous == (Image *) NULL)
743 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
745 if (status == MagickFalse)
749 yuv_image=DestroyImage(yuv_image);
750 if (image->previous == (Image *) NULL)
752 status=SetImageProgress(image,SaveImageTag,1,3);
753 if (status == MagickFalse)
757 Initialize U channel.
759 if (interlace == PartitionInterlace)
761 (void) CloseBlob(image);
762 AppendImageFormat("U",image->filename);
763 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
764 if (status == MagickFalse)
767 for (y=0; y < (ssize_t) chroma_image->rows; y++)
769 p=GetVirtualPixels(chroma_image,0,y,chroma_image->columns,1,
771 if (p == (const Quantum *) NULL)
773 for (x=0; x < (ssize_t) chroma_image->columns; x++)
776 (void) WriteBlobByte(image,ScaleQuantumToChar(
777 GetPixelGreen(chroma_image,p)));
779 (void) WriteBlobShort(image,ScaleQuantumToShort(
780 GetPixelGreen(chroma_image,p)));
781 p+=GetPixelChannels(chroma_image);
784 if (image->previous == (Image *) NULL)
786 status=SetImageProgress(image,SaveImageTag,2,3);
787 if (status == MagickFalse)
791 Initialize V channel.
793 if (interlace == PartitionInterlace)
795 (void) CloseBlob(image);
796 AppendImageFormat("V",image->filename);
797 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
798 if (status == MagickFalse)
801 for (y=0; y < (ssize_t) chroma_image->rows; y++)
803 p=GetVirtualPixels(chroma_image,0,y,chroma_image->columns,1,
805 if (p == (const Quantum *) NULL)
807 for (x=0; x < (ssize_t) chroma_image->columns; x++)
810 (void) WriteBlobByte(image,ScaleQuantumToChar(
811 GetPixelBlue(chroma_image,p)));
813 (void) WriteBlobShort(image,ScaleQuantumToShort(
814 GetPixelBlue(chroma_image,p)));
815 p+=GetPixelChannels(chroma_image);
818 if (image->previous == (Image *) NULL)
820 status=SetImageProgress(image,SaveImageTag,2,3);
821 if (status == MagickFalse)
825 chroma_image=DestroyImage(chroma_image);
826 if (interlace == PartitionInterlace)
827 (void) CopyMagickString(image->filename,image_info->filename,
829 if (GetNextImageInList(image) == (Image *) NULL)
831 image=SyncNextImageInList(image);
832 status=SetImageProgress(image,SaveImagesTag,scene++,
833 GetImageListLength(image));
834 if (status == MagickFalse)
836 } while (image_info->adjoin != MagickFalse);
837 (void) CloseBlob(image);