iipsrv icon indicating copy to clipboard operation
iipsrv copied to clipboard

IIIF info.json uri auto extension

Open joesong168 opened this issue 1 year ago • 3 comments

According to IIIF Image API(https://iiif.io/api/image/3.0/#2-uri-syntax), uri: '{scheme}://{server}{/prefix}/{identifier}' should be extended to '{scheme}://{server}{/prefix}/{identifier}/info.json' by default. Some existing client has already take it as granted. Would IIPImage implement this?

joesong168 avatar Aug 31 '22 07:08 joesong168

IIPImage already implements this using a 303 HTTP status as recommended in the specification

ruven avatar Aug 31 '22 12:08 ruven

Looks like the redirection occurs correctly when the image is not placed in any subfolders. But when I use subfolders I get a HTTP 400 BadRequest https://myexempleserver.com/iiif/image.tif -> is correctly redirected to https://myexempleserver.com/iiif/image.tif/info.json but https://myexempleserver.com/iiif/folder/image.tif -> HTTP 400 I Was thinking about doing a apache redirection myself

EDIT: it was mentionned in this issue #126

TitouanBoudart avatar Sep 05 '22 09:09 TitouanBoudart

The problem you are having is due to the image path needing to be URL encoded. The IIIF specification (https://iiif.io/api/image/3.0/#9-uri-encoding-and-decoding) says that all special characters in the image name or path (including slashes) need to be URL encoded. This is necessary to ensure the IIIF syntax slashes are not miss-interpreted.

The complication here is that you in fact need to double URL encode the slash for this to work correctly (see discussion here: https://github.com/ruven/iipsrv/issues/44) , so a slash becomes %252F (rather than just %2F for single URL encoding).

Thus, your URL needs to be:

https://myexempleserver.com/iiif%252Ffolder/image.tif

which will redirect correctly to info.json

ruven avatar Sep 05 '22 12:09 ruven