Method

VipsTargetread

Declaration [src]

gint64
vips_target_read (
  VipsTarget* target,
  void* buffer,
  size_t length
)

Description [src]

Read up to length bytes from target and store the bytes in buffer. Return the number of bytes actually read. If all bytes have been read from the file, return 0.

Arguments exactly as read().

Reading from a target sounds weird, but libtiff needs this for multi-page writes. This method will fail for targets like pipes.

Parameters

buffer

Type: void*

Store bytes here.

The argument can be NULL.
The data is owned by the caller of the method.
length

Type: size_t

Length of buffer in bytes.

Return value

Type: gint64

The number of bytes read, 0 on end of file, -1 on error.