# HG changeset patch # User robcast # Date 1497276284 -7200 # Node ID 248c7df143cf77083b8042843bf0d2afbe137d67 # Parent ba6e93840f38c594b4ddc4b74eee9acb7a0990ec# Parent 3972535c1146ebfb4619eb99daab73a656bdb534 Merge from HEAD 3972535c1146ebfb4619eb99daab73a656bdb534 diff -r ba6e93840f38 -r 248c7df143cf common/doc/Scaler.html --- a/common/doc/Scaler.html Fri Jun 02 12:44:58 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ - - - - -Scaler servlet - - -

Scaler

- -

A Servlet for scaling images. (Version 1.5.2)

- -

Web API

- -

The Scaler servlet takes parameters in the http request format: -Scaler/request_path/?param1=value1&param2=value2&... -Unknown parameters will be silently ignored.

- -

Recognised parameters:

- - -

The image to be loaded can be specified by the - request_path (deprecated) or the fn - (preferred) parameter and the optional index pn

- - -

The image will be scaled equally in horizontal and vertical - direction such that the resulting image does not exceed the rectangle - [dw,dh]. If only either height or width is given the - image is scaled to match only the given parameter. The size of the - resulting image in the other parameter is determined by the aspect - ratio of the image. -

- - - diff -r ba6e93840f38 -r 248c7df143cf common/src/main/java/digilib/conf/DigilibRequest.java --- a/common/src/main/java/digilib/conf/DigilibRequest.java Fri Jun 02 12:44:58 2017 +0200 +++ b/common/src/main/java/digilib/conf/DigilibRequest.java Mon Jun 12 16:04:44 2017 +0200 @@ -355,7 +355,7 @@ /* * parse sequence of parameters as IIIF image API */ - String identifier = null; + String identifier = ""; // empty name means image root directory String region = null; String size = null; String rotation = null; diff -r ba6e93840f38 -r 248c7df143cf doc/src/site/markdown/iiif-api.md --- a/doc/src/site/markdown/iiif-api.md Fri Jun 02 12:44:58 2017 +0200 +++ b/doc/src/site/markdown/iiif-api.md Mon Jun 12 16:04:44 2017 +0200 @@ -1,8 +1,10 @@ # The digilib IIIF API +## IIIF Image API + The Scaler servlet provides not only its native [Scaler API](scaler-api.html) but also an API compliant to the standards of the International Image Interoperability Framework http://iiif.io. -As of version 2.3.7 digilib supports the [IIIF Image API version 2](http://iiif.io/api/image/2.0/) at [compliance level 2](http://iiif.io/api/image/2.0/compliance.html). You can switch between API version 1.1 and 2.0 support with the `iiif-api-version` parameter in [digilib-config](digilib-config.html), +As of version 2.3.7 digilib supports the [IIIF Image API version 2](http://iiif.io/api/image/2.1/) at [compliance level 2](http://iiif.io/api/image/2.0/compliance.html). You can switch between API version 1.1 and 2.0 support with the `iiif-api-version` parameter in [digilib-config](digilib-config.html), IIIF Image API URLs for an image request have the form: @@ -23,3 +25,23 @@ An info request URL for the same image looks like: http://www.example.org/digilib/Scaler/IIIF/books!book1!page0002/info.json + +## IIIF Presentation API + +As of version 2.5.3 digilib provides the optional Manifester servlet that generates simple [IIIF Presentation API version 2](http://iiif.io/api/presentation/2.1) manifests that can be used with any [IIIF viewer](http://iiif.io/apps-demos/#image-viewing-clients) to navigate a directory full of images with the functions of a book-reader or light-table. + +To build digilib with the Manifester servlet you need to add the `iiif-presentation` profile to your Maven build: + + mvn -Piiif-presentation package + +(or use the digilib-webapp-X.X.X-srv3p.war file from the website) + +The Manifester servlet URLs have the form: + + http[s]://{server}/{digilib-webapp}/Manifester/{iiif-prefix}/{identifier} + +So you can get a manifest for all images in the directory `/books/book1` with a URL like: + + http://www.example.org/digilib/Manifester/IIIF/books!book1 + +To try out a viewer on your manifest you can go to the website of the Universal Viewer [http://universalviewer.io/](http://universalviewer.io/) and enter the URL of your manifest in the "view a manifest" box on the page. This will work even with a local digilib installation since the Javascript in your Browser reads and interprets the manifest. diff -r ba6e93840f38 -r 248c7df143cf iiif-presentation/src/main/java/digilib/servlet/Manifester.java --- a/iiif-presentation/src/main/java/digilib/servlet/Manifester.java Fri Jun 02 12:44:58 2017 +0200 +++ b/iiif-presentation/src/main/java/digilib/servlet/Manifester.java Mon Jun 12 16:04:44 2017 +0200 @@ -202,11 +202,9 @@ return; } // get identifier (first parameter) - String identifier = iiifParams.get(0); - if (identifier == null) { - logger.error("IIIF identifier missing"); - response.sendError(HttpServletResponse.SC_BAD_REQUEST, "IIIF identifier missing."); - return; + String identifier = ""; // allow empty identifier for image root dir + if (iiifParams.size() > 0) { + identifier = iiifParams.get(0); } // decode identifier to file path dlRequest.setValueFromString("fn", dlRequest.decodeIiifIdentifier(identifier)); diff -r ba6e93840f38 -r 248c7df143cf webapp/src/main/webapp/WEB-INF/digilib-config.xml.off --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webapp/src/main/webapp/WEB-INF/digilib-config.xml.off Mon Jun 12 16:04:44 2017 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +