From 456567af591bdc4f77e9f88aece939ab2e5592a9 Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Wed, 18 Dec 2019 17:52:39 +0100 Subject: [PATCH] Fix error in IIIF version detection --- src/iiiftilesource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 2f07f461..96a75bb1 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -215,14 +215,14 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea if (Array.isArray(context)) { for (var i = 0; i < context.length; i++) { if (typeof context[i] === 'string' && - ( /^http:\/\/iiif\.io\/api\/image\/[0-2]\/context\.json$/.test(context[i]) || + ( /^http:\/\/iiif\.io\/api\/image\/[1-3]\/context\.json$/.test(context[i]) || context[i] === 'http://library.stanford.edu/iiif/image-api/1.1/context.json' ) ) { context = context[i]; break; } } } - switch (data['@context']) { + switch (context) { case 'http://iiif.io/api/image/1/context.json': case 'http://library.stanford.edu/iiif/image-api/1.1/context.json': data.version = 1;