Allow for IIIF 2 image profile to be a string instead of a list
While the IIIF Image API 2 spec requires `profile` to be a list with a compliance level URI as first entry, some image servers just set `profile` to a string with the URI as value.
This commit is contained in:
parent
5334533d94
commit
e54189984f
|
@ -412,6 +412,12 @@ dlfUtils.iiifProfiles = {
|
|||
*/
|
||||
dlfUtils.buildImageV2 = function buildImageV2(mimetype, uri, jsonld) {
|
||||
|
||||
if (typeof jsonld.profile == "string") {
|
||||
jsonld.profile = [jsonld.profile, {}];
|
||||
}
|
||||
if (jsonld.profile !== undefined && jsonld.profile.length < 2) {
|
||||
jsonld.profile.push({});
|
||||
}
|
||||
var levelProfile = jsonld.profile === undefined || dlfUtils.iiifProfiles[jsonld.profile[0]] === undefined ? dlfUtils.iiifProfiles['none'] : dlfUtils.iiifProfiles[jsonld.profile[0]];
|
||||
return {
|
||||
src: uri,
|
||||
|
|
Loading…
Reference in New Issue