Skip to content

IIIF Features

Jeremy Echols edited this page Jan 31, 2024 · 4 revisions

RAIS - IIIF Feature Support

Features

Full list of IIIF features supported:

  • Region:
    • "full"
    • "square"
    • "x,y,w,h": regionByPx
    • "pct:x,y,w,h": regionByPct
  • Size:
    • "full"
    • "max"
    • "w," / sizeByW
    • ",h" / sizeByH
    • "pct:x" / sizeByPct
    • "w,h" / sizeByForcedWH
    • "!w,h" / sizeByWH
    • "sizeAboveFull"
    • "sizeByConfinedWh"
    • "sizeByDistortedWh"
  • Rotation:
    • 0
    • "90,180,270" / rotationBy90s
    • "!0,!90,!180,!270" / mirroring
  • Quality:
    • "default"
    • "native" (same as "default")
    • "color"
    • "gray"
    • "bitonal"
  • Format:
    • jpg (This is the best format for a speedy encode and small download)
    • png
    • tif
    • gif (Note that this is VERY slow for some reason, and so is disabled by default)
  • HTTP Features:
    • baseUriRedirect
    • cors
    • jsonldMediaType

To customize the capabilities for all images, a TOML file can be specified on the command-line via --capabilities-file [filename], the config value CapabilitiesFile, or using the environment variable RAIS_CAPABILITIESFILE. You can remove undesired capabilities from the list of what RAIS supports, which will prevent them from working if a client requests them. This can be helpful to avoid denial-of-service vectors, such as the extremely slow GIF output (though this is now disabled by default). See cap-max.toml for an example that shows all currently supported features.

info.json

RAIS generates a dynamic info.json response for IIIF servers (such as OpenSeadragon) by reading the source file and making some assumptions.

If you need a custom info.json response, you can create a file with the same name as the JP2, with "-info.json" appended at the end. e.g., source.jp2-info.json. This can be useful for limiting features, setting custom resize values, etc. To keep the system working on any URL, you can set the @id value in the custom JSON to %ID%. Since IIIF ids are a full URL, changing paths, URLs, or ports will break custom info.json files unless you allow the system to fill in the ID. See the test info.json file in our repository for an example.

An example INFO URL, would look like http://example.com/iiif/source.jp2/info.json (assuming, of course, that the IIIF URL was specified as "http://example.com/iiif" and the file "source.jp2" exists relative to the configured tile path).