NAME

IIIF::ImageAPI - IIIF Image API implementation as Plack application

SYNOPSIS

use Plack::Builder;
use IIIF::ImageAPI;

builder {
    enable 'CrossOrigin', origins => '*';
    IIIF::ImageAPI->new(
        images  => 'path/to/images',
        base    => 'https://example.org/iiif/',
        formats => [qw(jpg png gif tif pdf webp jp2)],
    );
}

CONFIGURATION

images

Either an image directory (set to the current directory by default) or a code reference of a function that maps image identifiers to image files.

cache

Cache directory. Set to a temporary per-process directory by default. Please use different cache directories for different settings of maxWidth and maxHeight.

base

Base URI which the service is hosted at, including trailing slash. Likely required if the service is put behind a web proxy.

canonical

Redirect requests to the canonical URI syntax and include (disabled by default). A canonical Link header is set anyway.

formats

List of supported image formats. Set to ['jpg', 'png', 'gif'] by default. On configuration with other formats make sure ImageMagick supports them (see "REQUIREMENTS" in IIIF::Magick).

preferredFormats

Optional list of preferred image formats. MUST be a subset of or equal to formats. The first preferred format, if given, will be used as default if a request does no specify a file format.

maxWidth

Optional maximum width in pixels to be supported.

maxHeight

Optional maximum height in pixels to be supported.

maxArea

Optional maximum pixel area (width x height) to be supported.

rights

Optional string that identifies a license or rights statement for all images, to be included in image information responses.

service

Optional array with Services to be included in image information responses.

magick_args

Additional command line arguments always used when calling ImageMagick. For instance [qw(-limit memory 1GB -limit disk 1GB)] to limit resources.