Closed somnolik closed 6 years ago
you could try a safe identifier and matching it using regular expressions to your path. see https://github.com/dbmdz/iiif-server-hymir/blob/master/src/main/resources/de/digitalcollections/core/config/multiPatternResolving-PROD.yml
something like this: identifier "images-set01-01" could be matched by a regular expression using groups
maybe you have to write one regex for each directory depthness (number of "-" hyphens)...
Could this work for you?
Yes, thank you, this is a suitable workaround. For future reference, this is the regex pattern we use, with double hyphens '--' as substitution for forward slashes, no hyphens allowed within the path, and file extensions with 3 or 4 letters, digits or underscore:
- pattern: ^([^-/]+)\.(\w{3,4})$
substitutions:
- 'file:/images/$1.$2'
- pattern: ^([^-/]+)(?:--)([^-/]+)\.(\w{3,4})$
substitutions:
- 'file:/images/$1/$2.$3'
- pattern: ^([^-/]+)(?:--)([^-/]+)(?:--)([^-/]+)\.(\w{3,4})$
substitutions:
- 'file:/images/$1/$2/$3.$4'
# iterate as needed
Example identifier: 1874--18740501--page0004.jpg
which would be mapped to 1874/18740501/page0004.jpg
image/<id>/view.html
endpoint that include a subpath (likeimages/set01/01.tif
) result in a 404 errorimages%2Fset01%2F01.tif
) result in a 500 errorThe same behaviour occurs with other urlencoded characters like '(' (%28) or ')' (%29). I'm aware that directly including the character '/' in the ID is forbidden per IIIF Image API; some other IIIF-Servers support it though.
Is there currently a way in Hymir to serve images in arbitrarily deep directory structures without explicitly enumerating each subdirectory?