Work with the IIIF Image API
Work with the IIIF Image API
CONTENTdm uses the IIIF Image API to build its default image display. Below are two examples of CONTENTdm image records, one from a site utilizing the Cantaloupe image server, the other from a site utilizing the legacy image server. Click the double diagonal arrow button on the upper-right corner of the image to see the viewer:
- Item in Cantaloupe site: https://sandbox.contentdm.oclc.org/digital/collection/coll16/id/357
- Item in non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/digital/collection/oclcsample/id/64
To verify that a CONTENTdm image is supported by the IIIF Image API, a request can be made to return a JSON document providing image information including width, height, and scaling information. The CONTENTdm image information URL patterns follow the IIIF Image API specification, but differ slightly based on whether the CONTENTdm site is on the Cantaloupe image server or not:
- Cantaloupe site: yourCONTENTdmURL/digital/iiif/2/{collection alias}:{record ID}/info.json
- Non-Cantaloupe site: yourCONTENTdmURL/digital/iiif/{collection alias}/{record ID}/info.json
For the example record noted above, the "info.json" URL is:
- Cantaloupe site: https://sandbox.contentdm.oclc.org/digital/iiif/2/coll16:357/info.json
- Non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/digital/iiif/oclcsample/64/info.json
The IIIF Image API is a powerful and flexible service for interaction with digital images. For example, here's a request to generate a JPEG of the entire image at 15% zoom:
- Cantaloupe site: https://sandbox.contentdm.oclc.org/digital/iiif/2/coll16:357/full/pct:15/0/default.jpg
- Non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/digital/iiif/oclcsample/64/full/pct:15/0/default.jpg
Here is another request, showing a selected detail from the full image:
- Cantaloupe site: https://sandbox.contentdm.oclc.org/digital/iiif/2/coll16:357/1500,1000,1200,1400/pct:15/0/default.jpg
- Non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/digital/iiif/oclcsample/64/1500,1000,1200,1400/pct:15/0/default.jpg
Here is one more example, showing the image resized for use as a thumbnail image:
- Cantaloupe site: https://sandbox.contentdm.oclc.org/digital/iiif/2/coll16:357/full/150,/0/default.jpg
- Non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/digital/iiif/oclcsample/64/full/150,/0/default.jpg
For more information on these and other methods for calling the CONTENTdm IIIF Image API service, consult the IIIF Image API specification.
Find your image server type
Your experience with using the IIIF Image API will differ depending on if your site has been moved to the Cantaloupe image server, or your site is on the legacy image server. If you don’t know whether your CONTENTdm site is on the Cantaloupe image server or not, please use the steps below to test.
- Try to access the following URL: yourCONTENTdmURL/iiif/manifest.json
- You are on the Cantaloupe server if the URL resolves and you are auto-directed to: yourCONTENTdmURL/iiif/2/manifest.json
- You are on the legacy server if the URL does not resolve.
Using the above example, you can see the different behaviors for the two types of sites:
- Item in Cantaloupe site: https://sandbox.contentdm.oclc.org/iiif/manifest.json
- Item in non-Cantaloupe site: https://cdm17328.contentdm.oclc.org/iiif/manifest.json