Fixed: ID field parsing on IIIF tile sources

The IIIF specification allows for the ID field to be either with or without
an "@" prefix for IIIFv3. (See: https://iiif.io/api/image/3.0/) Currently OSD
will fail to parse an image block that uses the non-prefixed form.

This PR changes the IIIF tile source parsing to allow for both forms of the
`id` key.
This commit is contained in:
Andrew Hankinson 2022-06-14 08:57:00 +02:00
parent bf395c1633
commit 6eeccb530b

View File

@ -51,7 +51,7 @@ $.IIIFTileSource = function( options ){
$.extend( true, this, options ); $.extend( true, this, options );
if ( !( this.height && this.width && this['@id'] ) ) { if ( !( this.height && this.width && (this['@id'] || this['id']) ) ) {
throw new Error( 'IIIF required parameters not provided.' ); throw new Error( 'IIIF required parameters not provided.' );
} }