Function

Vipsmagickload

Declaration [src]

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

Description [src]

Optional arguments:

  • page: %gint, load from this page
  • n: %gint, load this many pages
  • density: string, canvas resolution for rendering vector formats like SVG

Read in an image using libMagick, the ImageMagick library. This library can read more than 80 file formats, including SVG, BMP, EPS, DICOM and many others. The reader can handle any ImageMagick image, including the float and double formats. It will work with any quantum size, including HDR. Any metadata attached to the libMagick image is copied on to the VIPS image.

The reader should also work with most versions of GraphicsMagick. See the “—with-magickpackage” configure option.

The file format is usually guessed from the filename suffix, or sniffed from the file contents.

Normally it will only load the first image in a many-image sequence (such as a GIF or a PDF). Use page and n to set the start page and number of pages to load. Set n to -1 to load all pages from page onwards.

density is “WxH” in DPI, e.g. “600x300” or “600” (default is “72x72”). See the density docs on the imagemagick website.

See also: vips_image_new_from_file().

This function is not directly available to language bindings

Parameters

filename const char*
 

File to load.

 The data is owned by the caller of the function.
 The value 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.
...
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.