From 6eeccb530baf049e80cc429558c7fa61ebd0f165 Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Tue, 14 Jun 2022 08:57:00 +0200 Subject: [PATCH] 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. --- src/iiiftilesource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 921ccd12..5b47b266 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -51,7 +51,7 @@ $.IIIFTileSource = function( 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.' ); }