Method

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

Do not use it if length is greater than UINT_MAX. GByteArray stores the length of its data in guint, which may be shorter than size_t.

Parameters

data unsigned char**
 

Return a pointer to the bytes read here.

 The data is owned by the caller of the function.
length size_t
 

Max number of bytes to read.

Return value

Returns: gint64
 

Number of bytes read, or -1 on error.