Galia Guide 1.0

Image Endpoints

Deep Zoom

About

Deep Zoom is a protocol developed by Microsoft consisting of two components:

  1. An XML manifest defining a source image, specifying its full size, format, and sizes of the tiles in the accompanying folder structure;
  2. An accompanying folder structure containing image tiles at all resolution levels, from 1×1 to the largest.

The idea is that the client—a deep-zooming viewer—will fetch the manifest and then, from that, be able to fetch the tiles it needs from the folder based on their relative pathname, which consists of a resolution level, tile grid offset, and format suffix. (Deep Zoom was designed so that all variant images would be generated in advance and served as static files.)

Deep Zoom is a minimalist protocol that is not a good candidate for generating thumbnails or variants of arbitrary size. It is only suitable for zooming viewers.

Documentation

Location

This endpoint is available by default at /dzi. This path can be changed using the endpoint.deepzoom.path configuration key.

Enabling

This endpoint can be enabled or disabled using the endpoint.deepzoom.enabled configuration key. When disabled, all requests to it will return HTTP 404.

IIIF Image API version 3

About

The IIIF Image API is a general-purpose HTTP-based image API. It supports access to arbitrary image regions at arbitrary scales, rotations, and color schemes, and in arbitrary formats, as supported by the server. It also supports access to image information including full size, tile sizes, and, if the server is so configured, embedded metadata.

The IIIF Image API endpoints are recommended for general image retrieval.

Documentation

Location

This endpoint is available by default at /iiif/3. This path can be changed using the endpoint.iiif.3.path configuration key.

Enabling

This endpoint can be enabled or disabled using the endpoint.iiif.3.enabled configuration key. When disabled, all requests to it will return HTTP 404.

Compliance

This API is implemented at a compliance level of 2.

Information response notes

sizes
An array of width/height pairs according to the formula dimension × 1/2n > endpoint.iiif.min_size. (To restrict access to only these sizes, use the endpoint.iiif.restrict_to_sizes configuration option.)
tiles
Contains a tile size that will be relatively efficient to deliver, along with a list of scale factors at which each size is available.
  • For images that are natively tiled, the width and height are a multiple of the native tile dimensions no smaller than the value of the endpoint.iiif.min_tile_size configuration key.
  • For untiled images, they are based on the endpoint.iiif.min_tile_size configuration key.
maxArea
This value reflects the settings of max_pixels and max_scale.
pageCount
This is a custom key, not specified in the Image API, that is automatically added to all information responses. For conventional images it will have a value of 1, but for formats that support multiple pages, like PDF, it will contain the number of pages in the file.
Other keys (attribution, service, etc.)
See Additional Information Response Keys.

Additional information response keys

In order to modify the information JSON response before it is sent to the client (such as to declare service profiles or add a rights statement), the delegate class needs to implement the customize_iiif3_information_response() method. An example implementation follows:

class CustomDelegate
  def customize_iiif3_information_response(info)
    info['rights'] = "http://example.org/license.html"
    info['service'] = {
      "@id"     => "https://example.org/auth/login",
      "@type"   => "AuthCookieService1",
      "profile" => "http://iiif.io/api/auth/1/login",
      "label"   => "Log In"
    }
  end
end

IIIF Image API version 2

Documentation

Location

This endpoint is available at /iiif/2. This path can be changed using the endpoint.iiif.2.path configuration key.

Enabling

This endpoint can be enabled or disabled using the endpoint.iiif.2.enabled configuration key. When disabled, all requests to it will return HTTP 404.

Compliance

Version 2.1.1 of this API is implemented at a compliance level of 2.

Information response notes

sizes
An array of width/height pairs according to the formula dimension × 1/2n > endpoint.iiif.min_size. (To restrict access to only these sizes, use the endpoint.iiif.restrict_to_sizes configuration option.)
tiles
Contains a tile size that will be relatively efficient to deliver, along with a list of scale factors at which each size is available.
  • For images that are natively tiled, the width and height are a multiple of the native tile dimensions no smaller than the value of the endpoint.iiif.min_tile_size configuration key.
  • For untiled images, they are based on the endpoint.iiif.min_tile_size configuration key.
profile.formats
This list of output formats depends on the setting of the encoder.formats configuration key. Only the formats listed in this key will be available.
profile.maxArea
This value reflects the settings of max_pixels and max_scale.
pageCount
This is a custom key, not specified in the Image API, that is automatically added to all information responses. For conventional images it will have a value of 1, but for formats that support multiple pages, like PDF, it will contain the number of pages in the file.
Other keys (attribution, service, etc.)
See Additional Information Response Keys.

Additional information response keys

In order to modify the information JSON response before it is sent to the client (such as to declare service profiles or, beginning in Image API 2.1, an optional rights statement and/or logo), the delegate class needs to implement the customize_iiif2_information_response() method. An example implementation follows:

class CustomDelegate
  def customize_iiif2_information_response(info)
    info['rights']  = "http://example.org/license.html"
    info['service'] = {
      "@id"     => "https://example.org/auth/login",
      "@type"   => "AuthCookieService1",
      "profile" => "http://iiif.io/api/auth/1/login",
      "label"   => "Log In"
    }
  end
end

IIIF Image API version 1

Documentation

Location

This endpoint is available at /iiif/1. This path can be changed using the endpoint.iiif.1.path configuration key.

Enabling

This endpoint can be enabled or disabled using the endpoint.iiif.1.enabled configuration key. When disabled, all requests to it will return HTTP 404.

Compliance

Version 1.1 of this API is implemented at a compliance level of 2.

Information response notes

tile_width and tile_height
These keys refer to tile dimensions that will be relatively efficient to deliver.
  • For images that are natively tiled, these will be the smallest of the native tile dimensions, the value of the endpoint.iiif.min_tile_size configuration key, or the full image dimensions.
  • For untiled images, these will be the smallest value of n for the formula: (smallest dimension) × 1/2n > endpoint.iiif.min_tile_size.
formats
This list of output formats depends on setting of the encoder.formats configuration key. Only the formats listed in this key will be available.
page_count
This is a custom key, not specified in the Image API, that is automatically added to all information responses. For conventional images it will have a value of 1, but for formats that support multiple pages, like PDF, it will contain the number of pages in the file.

Additional features

Image endpoints support these additional features:

Page selection

For image formats that support multiple pages within the same image file, a page number argument can be supplied in the identifier path component. See Meta-Identifiers for more information.

Metadata exposure

Metadata embedded within most supported formats can be exposed in IIIF information responses. See Viewing metadata.

Response content disposition

The Content-Disposition HTTP response header tells clients whether to attempt to display a response entity inline or download it, perhaps accompanied by a user prompt. A response-content-disposition query argument can be used to suggest a value to override that on a per-request basis. This is useful for "linking to a download." For example, the following URL will cause web browsers to download the image identified by some-identifier and save it as image.jpg:

http://my-image-server/iiif/3/some-identifier/full/max/0/default.jpg
    ?response-content-disposition=attachment%3B%20filename%3Dimage.jpg

The value of the query argument must be URL-encoded. In this case, the decoded form is: attachment; filename=image.jpg.

Overriding cache behavior

The behavior of the caches can be overridden on a per-request basis by supplying a cache URL query argument with one of the following values:

nocache or false
Bypasses the variant and info caches, and also omits any Cache-Control response header that may be configured.
recache
Bypasses the variant and info caches for reads but not writes.

Plugin implementations

If the other image endpoints don't meet your needs, custom image endpoints can be developed and supplied via the plugin mechanism. The example endpoint and Javadoc may be useful references.