Support IIIF 3 images in CreateIIIFURL
https://redmine.teklia.com/issues/10642
Requires #1971 (closed)
-
arkindex.images.iiif.ImageInformationmust be updated so thatversionis aLiteral[2, 3]to allow both version numbers. -
arkindex.images.iiif._parse_image_informationmust be updated to support both IIIF 2 and 3. We will go with the most flexible detection method.-
After the response is verified to be a
dict, the method must test whether@idandidexist on the dict.- When neither are defined, the existing
Missing required propertiescan be raised. - When both are defined, another error should be raised because the ID is duplicated.
- When
@idis defined, the parsing should continue for IIIF 2. - When
idis defined, the parsing should continue for IIIF 3.
- When neither are defined, the existing
-
The
widthandheightare parsed as they are now. -
In IIIF 3 only, the
profileshould not be required, as we do not use it anymore. -
In IIIF 2 only,
maxWidthandmaxHeightshould be first parsed inprofile[].maxWidthandprofile[].maxHeightas they are now. When they were not found, they should be parsed like IIIF 3, as some servers were using a non-standard location that happened to be the correct one for IIIF 3. -
In IIIF 3 and in the aforementioned IIIF 2 edge case,
maxWidthandmaxHeightshould be found in the root dict, but they are optional. -
The method should now return an
ImageInformationwith the correct version, and with the URL coming from either@idorid.
-
-
ImageServer.check_optionsmust be updated to support version 3. Instead of failing when the version is not 2, it should check that its version matches the version sent to the function. -
ImageServer.objects.create_from_image_informationmust only use the/iiif/2/prefix with IIIF 2, and must now also support/iiif/3/with IIIF 3. -
Unit tests should be added to:
-
get_image_informationto verify all the updated parsing; -
CreateIIIFURLto verify that we can create IIIF 3 images, and that an unexpected version on an existing server causes an error; -
Image.perform_checkto verify that we can check IIIF 3 images, and that an unexpected version causes an error; -
ImageServer.objects.create_from_image_informationto verify that theversionis set correctly and that the version-specific prefixes are handled with the correct versions.
-