This version of the manual refers to an earlier version of the software.

Endpoints

IIIF Image API 1.x

Documentation

Location

This endpoint is available at /iiif/1.

Compliance

Cantaloupe implements version 1.1 of this API, for compatibility with all 1.x clients. Compliance level is dynamically computed and declared on a per-processor basis. Most processors are "Level 2"-compliant.

Information Response Notes

tile_width and tile_height
These keys contain 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 the processor assigned to the format of the source image.
qualities
Depends on the qualities supported by the processor assigned to the format of the source image.
profile
Dynamically computed based on the features supported by the processor assigned to the format of the source image, as well as features built into the image server itself.

Enabling/Disabling

This endpoint can be enabled or disabled by setting endpoint.iiif.1.enabled to true or false in the configuration file.


IIIF Image API 2.x

Documentation

Location

This endpoint is available at /iiif/2.

Compliance

Cantaloupe implements version 2.1 of this API, for compatibility with all 2.x clients. Compliance level is dynamically computed and declared on a per-processor basis. Most processors are "Level 2"-compliant.

Information Response Notes

sizes
Contains an array of width/height pairs according to the formula dimension * 1/2n > 64. (It is possible to restrict access to only these sizes using the endpoint.iiif.2.restrict_to_sizes configuration option.)
tiles
Contains a list of tile sizes 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 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, they will be the smallest value of n for the formula: (smallest dimension) * 1/2n > endpoint.iiif.min_tile_size.
profile/formats
This list of output formats depends on the processor assigned to the format of the source image.
profile/maxArea
This value is based on the value of max_pixels in the configuration. If set to zero, it will be omitted.
profile/qualities
Depends on the qualities supported by the processor assigned to the format of the source image.
profile/supports
Dynamically computed based on the features supported by the processor assigned to the format of the source image, as well as features built into the image server itself.
Other keys (attribution, service, etc.)
See the Additional Information Response Keys section.

Additional Information Response Keys

In addition to the the server-supplied keys that appear in the information JSON response, custom keys can be added, such as to declare service profiles or, beginning in Image API 2.1, an optional rights statement and/or logo. The delegate script merely needs to implement the extra_iiif2_information_response_keys() method. An example implementation follows:

module Cantaloupe
  ##
  # Used to add additional keys to the information JSON response. including
  # `attribution`, `license`, `logo`, `service`, and custom keys. See
  # {http://iiif.io/api/image/2.1/#image-information the Image API
  # specification}.
  #
  # @param identifier [String] Image identifier
  # @return [Hash] Hash that will be merged into IIIF Image API 2.x
  #                information responses. Return an empty hash to add nothing.
  #
  def self.extra_iiif2_information_response_keys(identifier)
    {
        'attribution' =>  'Copyright My Great Organization. All rights '\
                          'reserved.',
        'license' =>  'http://example.org/license.html',
        'logo' =>  'http://example.org/logo.png',
        'service' => {
            '@context' => 'http://iiif.io/api/annex/services/physdim/1/context.json',
            'profile' => 'http://iiif.io/api/annex/services/physdim',
            'physicalScale' => 0.0025,
            'physicalUnits' => 'in'
        }
    }
  end
end

Enabling/Disabling

This endpoint can be enabled or disabled by setting endpoint.iiif.2.enabled to true or false in the configuration file.