Is there a way to request a IIIF resource via the image API, but set the tileFormat via OpenSeadragon?
See original GitHub issueI’ve been wondering on the best way to use the tileFormat
option from IIIFTileSource, with a tileSources
array that just specifies IIIF endpoints.
Using the JSON response directly and including the tileFormat
key in there seems to do the trick. However the output from my image server doesn’t include tileFormat
as this appears to be non-standard. I do have a formats array, but the values in here don’t seem to be used (i.e. if this only contains ‘png’ it will still choose ‘jpg’).
I could request each resource outside of OpenSeadragon and append the tileFormat myself (and I suspect this will be the simplest approach), but I wondered if there’s a way I’m missing that would signal to OpenSeadragon to use a different tileFormat
for all requests?
Edit:
In our particular use case, we have transparency and upon reflection we’d probably like other applications which consume these resources to use png and leverage that. For that reason we’re also considering if updating the response from the image server to include tileFormat
might serve our needs better.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
preferredFormats
is already supported, from the v3 work that @lutzhelm did:https://github.com/openseadragon/openseadragon/blob/master/src/iiiftilesource.js#L245
This should make OSD request tiles in the format hinted in the info.json, rather than the jpg default (unless jpg is the preferredFormat!)
This is ideal for when:
In practice, in large scale digitisation workflows, neither of these are often true. Instead, it’s a page-generation-time decision, e.g.,
We had a very similar need - the
preferredFormats
is really useful, but we also need to hint it from the client, optionally providing it where the info.json does not have it. This isn’t the same as forcing a tileFormat, because it’s a preference - if the image service can’t supply a webp or a heif or whatever you would like, you still want OSD to request the default, or a lower-ranked preference that it does support.It would be nice to have an easy way to insert a client-side
preferredFormats
list into the tileSource (the info.jsondata
) - this could even work for pre-version-3 image services.If you have the info.json data to hand already as the tileSource, you could just add it, but if you are passing OSD the image service URL I don’t know how best to push it in there.
@altert Would that be a change to OSD? I don’t really have a sense whether it would be a good addition… How true to IIIF would it be?
@azaroth42 @tomcrane Any thoughts on this hack?