pub fn blob_size(data: &[u8]) -> ImageResult<ImageSize> {
    let mut reader = Cursor::new(data);

    let mut header = [0; 12];
    reader.read_exact(&mut header)?;

    dispatch_header(&mut reader, &header)
}
/// Get the image size from a block of raw data.
///
/// # Arguments
/// * `data` - A Vec containing the data to parse for image size.
///
/// # Error
///
/// This method will return an [`ImageError`] under the following conditions:
///
/// * The header isn't recognized as a supported image format
/// * The data isn't long enough to find the size for the given format
///
/// # Examples
///
/// ```
/// use imagesize::blob_size;
///
/// // First few bytes of arbitrary data.
/// let data = vec![0x89, 0x89, 0x89, 0x89, 0x0D, 0x0A, 0x1A, 0x0A,
///                 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
///                 0x00, 0x00, 0x00, 0x7B, 0x01, 0x00, 0x01, 0x41,
///                 0x08, 0x06, 0x00, 0x00, 0x00, 0x9A, 0x38, 0xC4];
///
/// assert_eq!(blob_size(&data).is_err(), true);
/// ```
///
/// [`ImageError`]: enum.ImageError.html
Get the image size from a block of raw data.
Get the image size from a block of raw data .
pub fn blob_size(data: &[u8]) -> ImageResult<ImageSize> {
    let mut reader = Cursor::new(data);
    let mut header = [0; 12];
    reader.read_exact(&mut header)?;
    dispatch_header(&mut reader, &header)
}
pub fn blob_size ( data : & [ u8 ] ) -> ImageResult < ImageSize > { let mut reader = Cursor :: new ( data ) ; let mut header = [ 0 ; 12 ] ; reader . read_exact ( & mut header ) ? ; dispatch_header ( & mut reader , & header ) }
Get the image size from a block of raw data.
Get the image size from a block of raw data .
data
&[u8]
data
&[u8]
error
This method will return an [`ImageError`] under the following conditions.

The header isn't recognized as a supported image format
The data isn't long enough to find the size for the given format
This method will return an [ ` ImageError ` ] under the following conditions . The header isn ' t recognized as a supported image format The data isn ' t long enough to find the size for the given format
examples
```
use imagesize::blob_size.

First few bytes of arbitrary data.



[`ImageError`]: enum.ImageError.html
` ` ` use imagesize :: blob_size . First few bytes of arbitrary data . [ ` ImageError ` ] : enum . ImageError . html