### Constructor

# Vips Image tiffload

#### Declaration [src]

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

#### Description [src]

Read a TIFF file into a VIPS image.

It is a full baseline TIFF 6 reader, with extensions for tiled images, multipage images, XYZ and LAB colour space, pyramidal images and JPEG compression, including CMYK and YCbCr.

`page` means load this page from the file. By default the first page (page 0) is read.

`n` means load this many pages. By default a single page is read. All the pages must have the same dimensions, and they are loaded as a tall, thin “toilet roll” image. The `VIPS_META_PAGE_HEIGHT` metadata tag gives the height in pixels of each page. Use -1 to load all pages.

Setting `autorotate` to `TRUE` will make the loader interpret the orientation tag and automatically rotate the image appropriately during load.

If `autorotate` is `FALSE`, the metadata field `VIPS_META_ORIENTATION` is set to the value of the orientation tag. Applications may read and interpret this field as they wish later in processing. See `vips_autorot()`. Save operations will use `VIPS_META_ORIENTATION`, if present, to set the orientation of output images.

If `autorotate` is `TRUE`, the image will be rotated upright during load and no metadata attached. This can be very slow.

If `subifd` is -1 (the default), the main image is selected for each page. If it is 0 or greater and there is a SUBIFD tag, the indexed SUBIFD is selected. This can be used to read lower resolution layers from bioformats-style image pyramids.

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

When using libtiff 4.7.0+, the TIFF loader will limit memory allocation for decoding each input file to 50MB to prevent denial of service attacks. Set `unlimited` to remove this limit.

Any ICC profile is read and attached to the VIPS image as `VIPS_META_ICC_NAME`. Any XMP metadata is read and attached to the image as `VIPS_META_XMP_NAME`. Any IPTC is attached as `VIPS_META_IPTC_NAME`. The image description is attached as `VIPS_META_IMAGEDESCRIPTION`. Data in the photoshop tag is attached as `VIPS_META_PHOTOSHOP_NAME`.

Optional arguments

- `page`: `gint`, load this page
- `n`: `gint`, load this many pages
- `autorotate`: `gboolean`, use orientation tag to rotate the image during load
- `subifd`: `gint`, select this subifd index
- `fail_on`: `VipsFailOn`, types of read error to fail on
- `unlimited`: `gboolean`, remove all denial of service limits

See also

`vips_image_new_from_file()`, `vips_autorot()`.

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`

  Decompressed 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.