Method

VipsImagewrite_to_buffer

Declaration [src]

int
vips_image_write_to_buffer (
  VipsImage* in,
  const char* suffix,
  void** buf,
  size_t* size,
  ...
)

Description [src]

Writes in to a memory buffer in a format specified by suffix.

Save options may be appended to suffix as “[name=value,…]” or given as a NULL-terminated list of name-value pairs at the end of the arguments. Options given in the function call override options given in the filename.

Currently only TIFF, JPEG and PNG formats are supported.

You can call the various save operations directly if you wish, see vips_jpegsave_buffer(), for example.

See also: vips_image_write_to_memory(), vips_image_new_from_buffer().

This method is not directly available to language bindings.

Parameters

suffix const char*
 

Format to write.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
buf An array of guint8
 

Return buffer start here.

 The length of the array is specified in the size argument.
 The instance takes ownership of the data, and is responsible for freeing it.
size size_t*
 

Return buffer length here.

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

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.