]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 26 Jan 2014 13:51:09 +0000 (13:51 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 26 Jan 2014 13:51:09 +0000 (13:51 +0000)
MagickCore/blob.c

index ba6741271b82a7b18a0d278276aece101429cc95..c33581f202d03279707dc915b207667d63879113 100644 (file)
@@ -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);