kitodo / kitodo-presentation

Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
https://kitodo.org
GNU General Public License v3.0
38 stars 45 forks source link

IIIF image quality URL parameter should be dependent on IIIF version #307

Closed lutzhelm closed 5 years ago

lutzhelm commented 5 years ago

Kitodo.Presentation currently only uses native for the image quality URL parameter. This is fine for IIIF Image API version 1, but version 2.1 expects the image quality to be one of the values default, color, bitonal or gray and requires image servers to support at least the default quality. While many (maybe even most) version 2 image servers support the native quality and treat it like default, some servers don't.

Example from the British Library:

I'll provide a pull request.

lutzhelm commented 5 years ago

The example I provided does actually work in the viewer because the info.json provides the qualities in the profile. But this points to another problem - the viewer takes the very first value from that set and uses it for the image requests - in this case it is gray. The qualities that are actually available are default and bitonal (this information is provided by the linked default IIIF v2 level 2 profile https://iiif.io/api/image/2/level2.json) as well as gray and color that are additional features in the info.json. The viewer ignores any information from a linked profile.

IIIF v1 requires neither quality nor profile to be present in the info.json, but native has to be supported for every compliance level. IIIF v2 requires profile to be present as a list and also requires the first entry to be a default compliance level profile. Additionally, every server has to support default.

In my opinion, the viewer should always use the native and accordingly default quality because they have to be supported by all IIIF image servers. If color is supported it might be used to be sure to get a defined full color quality image. I don't think there is a feature in Kitodo.Presentation that would require another quality than native / default and color.

The same problem could btw. occur with the formats. While every IIIF image server has to support jpg on any compliance level in any version (except v1 level 0, but level 0 is currently not supported anyway), the viewer would currently use the first entry in a set of additionally provided formats. This could be a format that is not supported by all browsers - resulting in a broken image view.

I'd suggest to always use jpg.

sebastian-meyer commented 5 years ago

Both your suggestions sound reasonable to me. Would you provide a fix for that?

lutzhelm commented 5 years ago

Done and tested for several IIIF v1 and v2 image servers.