### Method

# Vips Source sniff_at_most

#### Declaration [src]

    gint64
    vips_source_sniff_at_most (
      VipsSource* source,
      unsigned char** data,
      size_t length
    )

#### Description [src]

Attempt to sniff at most `length` bytes from the start of the source. A pointer to the bytes is returned in `data`. The number of bytes actually read is returned — it may be less than `length` if the file is shorter than `length`. A negative number indicates a read error.

#### Parameters

`data`

  Type: `unsigned char**`

  Return a pointer to the bytes read here.

  The data is owned by the caller of the method.

`length`

  Type: `size_t`

  Max number of bytes to read.

#### Return value

Type: `gint64`

Number of bytes read, or -1 on error.