IIIFImagePlug.V3 (IIIFImagePlug v0.5.0)

View Source

This plug implements the IIIF Image API version 3 (see also https://iiif.io/api/image/3.0/).

Options

:identifier_to_path_callback required

An arity 1 callback function that resolves a given IIIF identifier to a file path (string).

:max_width (default: 10000)

The maximum image width the plug will serve.

:max_height (default: 10000)

The maximum image height the plug will serve.

:max_area (default: 100000000)

The maximum amount of image pixels the plug will serve (does not necessarily have to be max_width * max_height).

:preferred_formats (default: [:jpg])

The preferred formats to be used for your service.

:extra_formats (default: [:png, :webp, :tif])

The extra formats your service can deliver. Note that TIF files have to be buffered before they are sent, so large images might cause issues.

:scheme (optional)

Callback function to override the scheme evaluated from the %Plug.Conn{}, useful if your Elixir app runs behind a proxy.

:host (optional)

Callback function to override the host evaluated from the %Plug.Conn{}, useful if your Elixir app runs behind a proxy.

:port (optional)

Callback function to override the port evaluated from the %Plug.Conn{}, useful if your Elixir app runs behind a proxy.

:identifier_to_rights_callback (optional)

An arity 1 callback function that returns a rights statement for a given identifier.

:identifier_to_part_of_callback (optional)

An arity 1 callback function that returns a list of part of properties for a given identifier.

:identifier_to_see_also_callback (optional)

An arity 1 callback function that returns a list of see also properties for a given identifier.

:identifier_to_service_callback (optional)

An arity 1 callback function that returns a list of service properties for a given identifier.

:status_callbacks (optional)

A map where each key is a HTTP status code (integer), and each value an arity 2 callback that can be used to replace the plug's default response. Each callback should accept a plug as its first parameter and a Map (containing the error message) as its second parameter.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, settings)

Callback implementation for Plug.call/2.

construct_id_url(conn, settings)

init(opts)

Callback implementation for Plug.init/1.