blob - Methods to Read or Write Binary Large OBjects

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- BlobToImage
- DestroyBlobInfo
- FileToBlob
- GetBlobInfo
- ImageToBlob
- SetBlobQuantum

# NAME

blob - Methods to Read or Write Binary Large OBjects

# SYNOPSIS

Image * BlobToImage( const ImageInfo *image_info, const void *blob, const size_t length, ExceptionInfo *exception );

void DestroyBlobInfo( BlobInfo *blob );

void * FileToBlob( const char *filename, size_t *length, ExceptionInfo *exception );

void GetBlobInfo( BlobInfo *blob );

void * ImageToBlob( const ImageInfo *image_info, Image *image, size_t *length, ExceptionInfo *exception );

void SetBlobQuantum( BlobInfo *blob, const size_t quantum );

# FUNCTION DESCRIPTIONS

## BlobToImage

Method BlobToImage implements direct to memory image formats. It returns the blob as an image.

The format of the BlobToImage method is:

> Image *BlobToImage ( const ImageInfo *image_info, const void *blob, const size_t length, ExceptionInfo *exception );

A description of each parameter follows:

image:
  Method BlobToImage returns an image from the supplied blob. If an error occurs NULL is returned.

image_info:
  The image info..

blob:
  The address of a character stream in one of the image formats understood by ImageMagick.

length:
  This size_t integer reflects the length in bytes of the blob.

exception:
  Return any errors or warnings in this structure.

## DestroyBlobInfo

Method DestroyBlobInfo deallocates memory associated with an BlobInfo structure.

The format of the DestroyBlobInfo method is:

> void DestroyBlobInfo ( BlobInfo *blob );

A description of each parameter follows:

blob:
  Specifies a pointer to a BlobInfo structure.

## FileToBlob

Method FileToBlob returns the contents of a file as a blob. It returns the file as a blob and its length.

The format of the FileToBlob method is:

> void *FileToBlob ( const char *filename, size_t *length, ExceptionInfo *exception );

A description of each parameter follows:

blob:
  Method FileToBlob returns the contents of a file as a blob. If an error occurs NULL is returned.

filename:
  The filename.

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.

exception:
  Return any errors or warnings in this structure.

## GetBlobInfo

Method GetBlobInfo initializes the BlobInfo structure.

The format of the GetBlobInfo method is:

> void GetBlobInfo ( BlobInfo *blob );

A description of each parameter follows:

blob:
  Specifies a pointer to a BlobInfo structure.

## ImageToBlob

Method ImageToBlob implements direct to memory image formats. It returns the image as a blob and its length. The magick member of the Image structure determines the format of the returned blob (GIG, JPEG, PNG, etc.).

The format of the ImageToBlob method is:

> void *ImageToBlob ( const ImageInfo *image_info, Image *image, size_t *length, ExceptionInfo *exception );

A description of each parameter follows:

blob:
  Method ImageToBlob returns a chunk of memory written in the desired image format (e.g. JPEG, GIF, etc.). If an error occurs NULL is returned.

image_info:
  The image info..

image:
  The image.

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.

exception:
  Return any errors or warnings in this structure.

## SetBlobQuantum

Method SetBlobQuantum set the current value of the blob quantum. This is the size in bytes to add to a blob when writing to a blob exceeds its current length.

The format of the SetBlobQuantum method is:

> void SetBlobQuantum ( BlobInfo *blob, const size_t quantum );

A description of each parameter follows:

blob:
  A pointer to a BlobInfo structure.

quantum:
  A size_t that reflects the number of bytes to increase a blob.