Class IIIFUrlHandler

java.lang.Object
io.goobi.viewer.controller.imaging.IIIFUrlHandler

public class IIIFUrlHandler extends Object
Utility class for constructing and parsing IIIF Image API and Presentation API URLs.
Author:
Florian Alpers
  • Constructor Details

    • IIIFUrlHandler

      public IIIFUrlHandler(AbstractApiUrlManager urls)
      Parameters:
      urls - API URL manager used to build image resource URLs
    • IIIFUrlHandler

      public IIIFUrlHandler(URI apiUrl)
    • IIIFUrlHandler

      public IIIFUrlHandler()
  • Method Details

    • getIIIFImageUrl

      public String getIIIFImageUrl(String fileUrl, String docStructIdentifier, String region, String size, String rotation, String quality, String format)
      Parameters:
      fileUrl - file path or URL of the image resource
      docStructIdentifier - record identifier (PI) of the parent document
      region - IIIF region parameter
      size - IIIF size parameter
      rotation - IIIF rotation parameter
      quality - IIIF quality parameter
      format - IIIF format parameter
      Returns:
      Generated URL
    • getIIIFImageUrl

      public String getIIIFImageUrl(String apiUrl, String inFileUrl, String docStructIdentifier, String region, String size, String rotation, String quality, String format)
      Returns a link to the actual image of the given page, delivered via IIIF api using the given parameters.
      Parameters:
      apiUrl - base URL of the IIIF image API
      inFileUrl - file path or URL of the image resource
      docStructIdentifier - record identifier (PI) of the parent document
      region - IIIF region parameter
      size - IIIF size parameter
      rotation - IIIF rotation parameter
      quality - IIIF quality parameter
      format - IIIF format parameter
      Returns:
      Generated URL
    • getIIIFImageUrl

      public String getIIIFImageUrl(String baseUrl, de.unigoettingen.sub.commons.contentlib.imagelib.transform.RegionRequest region, de.unigoettingen.sub.commons.contentlib.imagelib.transform.Scale size, de.unigoettingen.sub.commons.contentlib.imagelib.transform.Rotation rotation, de.unigoettingen.sub.commons.contentlib.imagelib.ImageType.Colortype quality, de.unigoettingen.sub.commons.contentlib.imagelib.ImageFileFormat format)
      Appends image request parameter paths to the given baseUrl.
      Parameters:
      baseUrl - base IIIF image identifier URL
      region - image region to extract
      size - scaling specification for the image
      rotation - rotation angle for the image
      quality - color type/quality for the image
      format - output image file format
      Returns:
      the complete IIIF image request URL
    • getModifiedIIIFFUrl

      public String getModifiedIIIFFUrl(String url, de.unigoettingen.sub.commons.contentlib.imagelib.transform.RegionRequest region, de.unigoettingen.sub.commons.contentlib.imagelib.transform.Scale size, de.unigoettingen.sub.commons.contentlib.imagelib.transform.Rotation rotation, de.unigoettingen.sub.commons.contentlib.imagelib.ImageType.Colortype quality, de.unigoettingen.sub.commons.contentlib.imagelib.ImageFileFormat format)
      Replaces the image request parameters in an IIIF URL with the given ones.
      Parameters:
      url - existing IIIF image URL to modify
      region - replacement image region parameter
      size - replacement scaling parameter
      rotation - replacement rotation parameter
      quality - replacement color type/quality parameter
      format - replacement output image file format
      Returns:
      the IIIF image URL with the specified parameters replaced
    • getUrlManager

      public AbstractApiUrlManager getUrlManager()
    • isIIIFUrl

      public boolean isIIIFUrl(String url)