From bb85d6a4f789118e8b2ed2653e9e05e95cc09a94 Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 26 Jan 2014 13:51:09 +0000 Subject: [PATCH] --- MagickCore/blob.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/MagickCore/blob.c b/MagickCore/blob.c index ba6741271..c33581f20 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -1535,7 +1535,6 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, /* Native blob support for this image format. */ - blob_info->length=0; blob_info->blob=(void *) AcquireQuantumMemory(image->columns, image->rows*sizeof(unsigned char)); if (blob_info->blob == (void *) NULL) @@ -1546,8 +1545,9 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, (void) CloseBlob(image); image->blob->exempt=MagickTrue; *image->filename='\0'; + blob_info->length=image->columns*image->rows; status=WriteImage(blob_info,image,exception); - *length=image->blob->length; + *length=image->blob->offset; blob=DetachBlob(image->blob); if (status == MagickFalse) blob=(unsigned char *) RelinquishMagickMemory(blob); @@ -1735,8 +1735,7 @@ MagickExport MagickBooleanType ImageToFile(Image *image,char *filename, % % o images: the image list. % -% o length: This pointer to a size_t integer sets the initial length of the -% blob. On return, it reflects the actual length of the blob. +% o length: return the actual length of the blob. % % o exception: return any errors or warnings in this structure. % @@ -1790,7 +1789,6 @@ MagickExport unsigned char *ImagesToBlob(const ImageInfo *image_info, /* Native blob support for this images format. */ - blob_info->length=0; blob_info->blob=(void *) AcquireQuantumMemory(images->columns, images->rows*sizeof(unsigned char)); if (blob_info->blob == (void *) NULL) @@ -1801,8 +1799,9 @@ MagickExport unsigned char *ImagesToBlob(const ImageInfo *image_info, (void) CloseBlob(images); images->blob->exempt=MagickTrue; *images->filename='\0'; + blob_info->length=images->columns*images->rows; status=WriteImages(blob_info,images,images->filename,exception); - *length=images->blob->length; + *length=images->blob->offset; blob=DetachBlob(images->blob); if (status == MagickFalse) blob=(unsigned char *) RelinquishMagickMemory(blob); -- 2.40.0