Class IIIFUrlHandler
java.lang.Object
io.goobi.viewer.controller.imaging.IIIFUrlHandler
Utility class for constructing and parsing IIIF Image API and Presentation API URLs.
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIIIFImageUrl(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.getIIIFImageUrl(String fileUrl, String docStructIdentifier, String region, String size, String rotation, String quality, String format) 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.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.boolean
-
Constructor Details
-
IIIFUrlHandler
- Parameters:
urls- API URL manager used to build image resource URLs
-
IIIFUrlHandler
-
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 resourcedocStructIdentifier- record identifier (PI) of the parent documentregion- IIIF region parametersize- IIIF size parameterrotation- IIIF rotation parameterquality- IIIF quality parameterformat- 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 APIinFileUrl- file path or URL of the image resourcedocStructIdentifier- record identifier (PI) of the parent documentregion- IIIF region parametersize- IIIF size parameterrotation- IIIF rotation parameterquality- IIIF quality parameterformat- 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 URLregion- image region to extractsize- scaling specification for the imagerotation- rotation angle for the imagequality- color type/quality for the imageformat- 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 modifyregion- replacement image region parametersize- replacement scaling parameterrotation- replacement rotation parameterquality- replacement color type/quality parameterformat- replacement output image file format- Returns:
- the IIIF image URL with the specified parameters replaced
-
getUrlManager
-
isIIIFUrl
-