IIIF

IIIF is an API specification designed to improve interoperability between digital image repositories.

For more information on IIIF please refer to http://iiif.io/

Please note that IIIF support requires additional web server configuration

ResourceSpace provides basic support for the IIIF presentation API and was originally created to link with the TMS plugin to enable publishing of resources related to a specified TMS object as a IIIF manifest, however TMS is not a requirement to enable the IIIF interface.

The ResourceSpace IIIF interface follows the guidance of the IIIF Presentation API 2.1 (as detailed at http://iiif.io/api/presentation/2.1/) for publishing the manifest

Presentation of resource images is designed to meet the minimum requirement (level 0) of the IIIF Image API 2.1 (http://iiif.io/api/image/2.1/)

  • Manifests are created based on search results returned for the specified identifier in the designated metadata field ($iiif_identifier_field)
  • The metadata for each manifest will be obtained from the first resource returned. If using TMS then the metadata stored in ResourceSpace is based on the object metadata retrieved from TMS and therefore will be the same for all resources with the same TMS object ID
  • Each canvas in the sequence described by a IIIF manifest will correspond to a ResourceSpace resource
  • The sequence of views published by the manifest will be based upon data stored in another ResourceSpace metadata field, thus allowing for reordering
  • At present there are no smaller preview sizes made available, only the full size JPG image
  • There is no zoom capability at present

Access/Publishing

  • To control which resources are published via IIIF and the access levels etc. the IIIF interface is configured to use the permissions of a standard ResourceSpace user account.
  • By using the permissions and access of a user account, resources can be made available or hidden from the IIIF interface by the use of standard metadata fields and search filters

Configuration

IMPORTANT: A URL rewrite rule must be configured on the web server to rewrite any paths under [resourcespace_url]/iiif to the IIIF handler file api/iiif/handler/php. Please see the bottom of this article for some information on standard web server rewrite configuration (Apache/IIS). Please refer to your web server configuration instructions for full instructions as to how to implement this

Example URLs that must be handled by this file:-

  • https://[resourcespace_url]/iiif/363792/manifest
  • https://[resourcespace_url]/iiif/image/363792/full/max/0/default.jpg
  • https://[resourcespace_url]/iiif/363792/canvas/0

The following configuration settings are used. These should be set in the ResourceSpace configuration file (include/config.php)

Setting Options Notes
$iiif_enabled Boolean (TRUE/FALSE) Sert to TRUE to enable the IIIF interface.
$iiif_userid Integer User ID to use for IIIF. This user should be granted access only to those resources that are to be published via IIIF using permissions and search filter
$iiif_identifier_field Integer Field that is used to hold the IIIF identifier e.g. if using TMS this may be the same as the TMS object field. This field must be indexed!
$iiif_description_field Integer Field that is used to hold the IIIF description
$iiif_sequence_field Integer Field that defines the position of a particular resource in the default sequence (only one sequence currently supported)
$iiif_sequence_prefix Text Optional prefix e.g. 'page_' that will be added to sequence identifier - useful if just numeric identifers are used e.g. for different views or pages

Additonal configuration options (Version 9.1 +)

From version 9.1 and later the following options are also available. These provide tiling support as well as the ability to request custom sizes. Whilst this does not meet the full requirements to meet compliance level 1 of the Image API, it does provide support for the widely used Mirador and Universal IIIF viewers.

Setting Options Notes
$iiif_custom_sizes Boolean (TRUE/FALSE) Set to true to support Mirador/Universal viewers that require the ability to request arbitrary sizes by 'w,', ',h' syntax. Note that this can result in significantly more storage space being required for each resource published via IIIF
$iiif_max_width Integer Maximum width in pixels that a custom request will be permitted for
$iiif_max_height Integer Maximum height in pixels that a custom request will be permitted for
$preview_tiles Boolean (TRUE/FALSE) Set to true to enable creation of preview tiles (used by IIIF viewers)
$preview_tiles_create_auto Boolean (TRUE/FALSE) Set to TRUE to create all preview tiles when normal previews are created. If set to FALSE tiles will only be created for a resource when a request is made for that resource's tiles
$preview_tile_scale_factors Array of integers e.g. array(1,2,4,8) Scale factors that tiles will be created for. For example if 2 is in the array then tiles will be created for the image at 1/2 of its original size. 16 will create tiles for trhe image at 1/16 of the original size.

Web server rewrite rules

Apache

The following steps can be used to set up a rewrite rule in Apache. Please refer to the configuration instructions for your own server to ensure these are correct for your version

  1. Enable apache rewrite functionality
    a2enmod rewrite
    
  2. Add the following to your virtual host configuration
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^ [NC]
    ReWriteBase "/"
    RewriteRule    "^iiif(.*)$"  "/api/iiif/handler.php" [PT] 
    
    e.g.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mycompany.resourcespace.com [NC]
    ReWriteBase "/"
    RewriteRule    "^iiif(.*)$"  "/api/iiif/handler.php" [PT] 
    

IIS

The following steps can be used to set up a rewrite rule in IIS (Windows server). Please refer to the configuration instructions for your own server to ensure these are correct for your version

  1. Open IIS Manager
  2. Select the ResourceSpace website
  3. Click on the 'URL Rewrite' icon in the right hand panel
  4. Click on 'View rewrite maps' in the top right actions menu
  5. Click on 'Add Rewrite Map' in the actions menu
  6. Add a name for the map e.g. 'IIIF'
  7. Click on 'Add Mapping Entry'
  8. Set '/iiif' as the original value and '/api/iiif/handler.php' as the new value and click OK
  9. Return to the Rewrite rules page and click on 'Add Rule(s)' in the top right actions menu
  10. Select 'Inbound rules' ->'Rule with rewrite map'
  11. Select 'Rewrite' as the rule action and the map you just created from the dropdown list. Click OK
  12. Once finished and saved, the rule summary should look as in the images below