Constructor

VipsImagepngload

Declaration [src]

int
vips_pngload (
  const char* filename,
  VipsImage** out,
  ...
)

Description [src]

Read a PNG file into a VIPS image. It can read all png images, including 8- and 16-bit images, 1 and 3 channel, with and without an alpha channel.

Any ICC profile is read and attached to the VIPS image. It also supports XMP metadata.

Use fail_on to set the type of error that will cause load to fail. By default, loaders are permissive, that is, VipsFailOn.

By default, the PNG loader limits the number of text and data chunks to block some denial of service attacks. Set unlimited to disable these limits.

::: tip “Optional arguments” * fail_on: VipsFailOn, types of read error to fail on * unlimited: gboolean, Remove all denial of service limits

::: seealso vips_image_new_from_file().

Parameters

filename const char*
 

File to load.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
out VipsImage
 

Decompressed image.

 The argument will be set by the function.
 The called function takes ownership of the data, and is responsible for freeing it.
... none
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.