Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIIF info.json uri auto extension #238

Open
joesong168 opened this issue Aug 31, 2022 · 3 comments
Open

IIIF info.json uri auto extension #238

joesong168 opened this issue Aug 31, 2022 · 3 comments

Comments

@joesong168
Copy link

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?

@ruven
Copy link
Owner

ruven commented Aug 31, 2022

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

@TitouanBoudart
Copy link

TitouanBoudart commented Sep 5, 2022

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

@ruven
Copy link
Owner

ruven commented Sep 5, 2022

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: #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants