- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- AttachBlob
- BlobToFile
- BlobToImage
- CloneBlobInfo
- DestroyBlob
- DetachBlob
- FileToBlob
- GetBlobError
- GetBlobFileHandle
- GetBlobInfo
- GetBlobStreamData
- GetBlobStreamHandler
- ImageToBlob
- ImageToFile
- IsBlobExempt
- IsBlobSeekable
- IsBlobTemporary
- PingBlob
- ReferenceBlob
- SetBlobExempt

# NAME

blob - Read or Write Binary Large OBjects

# SYNOPSIS

void AttachBlob( BlobInfo *blob_info, const void *blob, const size_t length );

MagickBooleanType BlobToFile( char *filename, const void *blob, const size_t length, ExceptionInfo *exception );

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

BlobInfo * CloneBlobInfo( const BlobInfo *blob_info );

void DestroyBlob( Image *image );

void DetachBlob( BlobInfo *blob_info );

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

MagickBooleanType GetBlobError( const Image *image );

FILE * GetBlobFileHandle( const Image *image );

void GetBlobInfo( BlobInfo *blob_info );

unsigned char * GetBlobStreamData( const Image *image );

StreamHandler GetBlobStreamHandler( const Image *image );

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

MagickBooleanType ImageToFile( Image *image, char *filename, ExceptionInfo *exception );

MagickBooleanType IsBlobExempt( const Image *image );

MagickBooleanType IsBlobSeekable( const Image *image );

MagickBooleanType IsBlobTemporary( const Image *image );

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

BlobInfo ReferenceBlob( BlobInfo *blob_info );

MagickBooleanType SetBlobExempt( const Image *image, const MagickBooleanType exempt );

# FUNCTION DESCRIPTIONS

## AttachBlob

> AttachBlob() attaches a blob to the BlobInfo structure.

The format of the AttachBlob method is:

> void AttachBlob ( BlobInfo *blob_info, const void *blob, const size_t length );

A description of each parameter follows:

blob_info:
  Specifies a pointer to a BlobInfo structure.

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.

## BlobToFile

> BlobToFile() writes a blob to a file. It returns MagickFalse if an error occurs otherwise MagickTrue.

The format of the BlobToFile method is:

> MagickBooleanType BlobToFile ( char *filename, const void *blob, const size_t length, ExceptionInfo *exception );

A description of each parameter follows:

filename:
  Write the blob to this file.

blob:
  The address of a blob.

length:
  This length in bytes of the blob.

exception:
  Return any errors or warnings in this structure.

## BlobToImage

> 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_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.

## CloneBlobInfo

> CloneBlobInfo() makes a duplicate of the given blob info structure, or if blob info is NULL, a new one.

The format of the CloneBlobInfo method is:

> BlobInfo *CloneBlobInfo ( const BlobInfo *blob_info );

A description of each parameter follows:

clone_info:
  Method CloneBlobInfo returns a duplicate of the given blob info, or if blob info is NULL a new one.

quantize_info:
  a structure of type info.

## DestroyBlob

> DestroyBlob() deallocates memory associated with a blob.

The format of the DestroyBlob method is:

> void DestroyBlob ( Image *image );

A description of each parameter follows:

image:
  The image.

## DetachBlob

> DetachBlob() detaches a blob from the BlobInfo structure.

The format of the DetachBlob method is:

> void DetachBlob ( BlobInfo *blob_info );

A description of each parameter follows:

blob_info:
  Specifies a pointer to a BlobInfo structure.

## FileToBlob

> FileToBlob() returns the contents of a file as a blob. It returns the file as a blob and its length. If an error occurs, NULL is returned.

The format of the FileToBlob method is:

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

A description of each parameter follows:

blob:
  `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.

## GetBlobError

> GetBlobError() returns MagickTrue if the blob associated with the specified image encountered an error.

The format of the GetBlobError method is:

> MagickBooleanType GetBlobError ( const Image *image );

A description of each parameter follows:

image:
  The image.

## GetBlobFileHandle

> GetBlobFileHandle() returns the file handleassociated with the image blob.

The format of the GetBlobFile method is:

> FILE *GetBlobFileHandle ( const Image *image );

A description of each parameter follows:

image:
  The image.

## GetBlobInfo

> GetBlobInfo() initializes the BlobInfo structure.

The format of the GetBlobInfo method is:

> void GetBlobInfo ( BlobInfo *blob_info );

A description of each parameter follows:

blob_info:
  Specifies a pointer to a BlobInfo structure.

## GetBlobStreamData

> GetBlobStreamData() returns the stream data for the image.

The format of the GetBlobStreamData method is:

> unsigned char *GetBlobStreamData ( const Image *image );

A description of each parameter follows:

image:
  The image.

## GetBlobStreamHandler

> GetBlobStreamHandler() returns the stream handler for the image.

The format of the GetBlobStreamHandler method is:

> StreamHandler GetBlobStreamHandler ( const Image *image );

A description of each parameter follows:

image:
  The image.

## ImageToBlob

> 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 ( GIF, JPEG, PNG, etc. )

The format of the ImageToBlob method is:

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

A description of each parameter follows:

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.

## ImageToFile

> ImageToFile() writes an image to a file. It returns MagickFalse if an error occurs otherwise MagickTrue.

The format of the ImageToFile method is:

> MagickBooleanType ImageToFile ( Image *image, char *filename, ExceptionInfo *exception );

A description of each parameter follows:

image:
  The image.

filename:
  Write the image to this file.

exception:
  Return any errors or warnings in this structure.

## IsBlobExempt

> IsBlobExempt() returns true if the blob is exempt.

The format of the IsBlobExempt method is:

> MagickBooleanType IsBlobExempt ( const Image *image );

A description of each parameter follows:

image:
  The image.

## IsBlobSeekable

> IsBlobSeekable() returns true if the blob is seekable.

The format of the IsBlobSeekable method is:

> MagickBooleanType IsBlobSeekable ( const Image *image );

A description of each parameter follows:

image:
  The image.

## IsBlobTemporary

> IsBlobTemporary() returns true if the blob is temporary.

The format of the IsBlobTemporary method is:

> MagickBooleanType IsBlobTemporary ( const Image *image );

A description of each parameter follows:

image:
  The image.

## PingBlob

> PingBlob() returns all the attributes of an image or image sequence except for the pixels. It is much faster and consumes far less memory than BlobToImage ( ) . On failure, a NULL image is returned and exception describes the reason for the failure.

The format of the PingBlob method is:

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

A description of each parameter follows:

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.

## ReferenceBlob

> ReferenceBlob() increments the reference count associated with the pixel blob returning a pointer to the blob.

The format of the ReferenceBlob method is:

> BlobInfo ReferenceBlob ( BlobInfo *blob_info );

A description of each parameter follows:

blob_info:
  The blob_info.

## SetBlobExempt

> SetBlobExempt() sets the blob exempt status.

The format of the SetBlobExempt method is:

> MagickBooleanType SetBlobExempt ( const Image *image, const MagickBooleanType exempt );

A description of each parameter follows:

image:
  The image.

exempt:
  Set to true if this blob is exempt from being closed.

"Image manipulation software that works like magick"