Vips.Image.svgload
Description: Reference for Vips.Image.svgload

### Constructor

# Vips Imagesvgload

#### Declaration [src]

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

#### Description [src]

Render a SVG file into a VIPS image.

Rendering uses the librsvg library and should be fast.

Use `dpi` to set the rendering resolution. The default is 72. Additionally, you can scale by setting `scale`. If you set both, they combine.

This function only reads the image header and does not render any pixel data. Rendering occurs when pixels are accessed.

SVGs larger than 10MB are normally blocked for security. Set `unlimited` to allow SVGs of any size.

A UTF-8 string containing custom CSS can be provided via `stylesheet`. During the CSS cascade, the specified stylesheet will be applied with a User Origin. This feature requires librsvg 2.48.0 or later.

If `high_bitdepth` is set and the version of cairo supports it (e.g. cairo >= 1.17.2), enable 128-bit scRGB output (32-bit per channel).

Optional arguments

- `dpi`: `gdouble`, render at this DPI
- `scale`: `gdouble`, scale render by this factor
- `unlimited`: `gboolean`, allow SVGs of any size
- `stylesheet`: `gchararray`, custom CSS
- `high_bitdepth`: `gboolean`, enable scRGB 128-bit output

See also

`vips_image_new_from_file()`.

This constructor is not directly available to language bindings.

#### Parameters

`filename`

  Type: `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`

  Type: `VipsImage`

  Output image.

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

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.