diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js
index 921ccd12..d1331cd3 100644
--- a/src/iiiftilesource.js
+++ b/src/iiiftilesource.js
@@ -51,8 +51,11 @@ $.IIIFTileSource = function( options ){
$.extend( true, this, options );
- if ( !( this.height && this.width && this['@id'] ) ) {
- throw new Error( 'IIIF required parameters not provided.' );
+ /* Normalizes v3-style 'id' keys to an "_id" internal property */
+ this._id = this["@id"] || this["id"] || this['identifier'] || null;
+
+ if ( !( this.height && this.width && this._id) ) {
+ throw new Error( 'IIIF required parameters (width, height, or id) not provided.' );
}
options.tileSizePerScaleFactor = {};
@@ -147,7 +150,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
* this tile source.
* @function
* @param {Object|Array} data
- * @param {String} optional - url
+ * @param {String} [url] - url
*/
supports: function( data, url ) {
@@ -180,23 +183,29 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
},
/**
+ * A static function used to prepare an incoming IIIF Image API info.json
+ * response for processing by the tile handler. Normalizes data for all
+ * versions of IIIF (1.0, 1.1, 2.x, 3.x) and returns a data object that
+ * may be passed to the IIIFTileSource.
*
* @function
+ * @static
* @param {Object} data - the raw configuration
* @param {String} url - the url configuration was retrieved from
* @param {String} postData - HTTP POST data in k=v&k2=v2... form or null
- * @example
IIIF 1.1 Info Looks like this
+ * @return {Object} A normalized IIIF data object
+ * @example IIIF 2.x Info Looks like this
* {
- * "@context" : "http://library.stanford.edu/iiif/image-api/1.1/context.json",
- * "@id" : "http://iiif.example.com/prefix/1E34750D-38DB-4825-A38A-B60A345E591C",
- * "width" : 6000,
- * "height" : 4000,
- * "scale_factors" : [ 1, 2, 4 ],
- * "tile_width" : 1024,
- * "tile_height" : 1024,
- * "formats" : [ "jpg", "png" ],
- * "qualities" : [ "native", "grey" ],
- * "profile" : "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0"
+ * "@context": "http://iiif.io/api/image/2/context.json",
+ * "@id": "http://iiif.example.com/prefix/1E34750D-38DB-4825-A38A-B60A345E591C",
+ * "protocol": "http://iiif.io/api/image",
+ * "height": 1024,
+ * "width": 775,
+ * "tiles" : [{"width":256, "scaleFactors":[1,2,4,8]}],
+ * "profile": ["http://iiif.io/api/image/2/level1.json", {
+ * "qualities": [ "native", "bitonal", "grey", "color" ],
+ * "formats": [ "jpg", "png", "gif" ]
+ * }]
* }
*/
configure: function( data, url, postData ){
@@ -204,13 +213,13 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
if ( !$.isPlainObject(data) ) {
var options = configureFromXml10( data );
options['@context'] = "http://iiif.io/api/image/1.0/context.json";
- options['@id'] = url.replace('/info.xml', '');
+ options["@id"] = url.replace('/info.xml', '');
options.version = 1;
return options;
} else {
if ( !data['@context'] ) {
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
- data['@id'] = url.replace('/info.json', '');
+ data["@id"] = url.replace('/info.json', '');
data.version = 1;
} else {
var context = data['@context'];
@@ -239,10 +248,8 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
$.console.error('Data has a @context property which contains no known IIIF context URI.');
}
}
- if ( !data['@id'] && data['id'] ) {
- data['@id'] = data['id'];
- }
- if(data.preferredFormats) {
+
+ if (data.preferredFormats) {
for (var f = 0; f < data.preferredFormats.length; f++ ) {
if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {
data.tileFormat = data.preferredFormats[f];
@@ -431,7 +438,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
iiifSize = iiifSizeW + ",";
}
}
- uri = [ this['@id'], iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );
+ uri = [ this._id, iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );
return uri;
},
@@ -482,7 +489,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
var levels = [];
for(var i = 0; i < options.sizes.length; i++) {
levels.push({
- url: options['@id'] + '/full/' + options.sizes[i].width + ',' +
+ url: options._id + '/full/' + options.sizes[i].width + ',' +
(options.version === 3 ? options.sizes[i].height : '') +
'/0/default.' + options.tileFormat,
width: options.sizes[i].width,
diff --git a/test/data/iiif_3_0_sizes/full/1600,1164/0/default.jpg b/test/data/iiif_3_0_sizes/full/1600,1164/0/default.jpg
new file mode 100644
index 00000000..9156c9d8
Binary files /dev/null and b/test/data/iiif_3_0_sizes/full/1600,1164/0/default.jpg differ
diff --git a/test/data/iiif_3_0_sizes/full/3200,2328/0/default.jpg b/test/data/iiif_3_0_sizes/full/3200,2328/0/default.jpg
new file mode 100644
index 00000000..7cad3870
Binary files /dev/null and b/test/data/iiif_3_0_sizes/full/3200,2328/0/default.jpg differ
diff --git a/test/data/iiif_3_0_sizes/full/400,291/0/default.jpg b/test/data/iiif_3_0_sizes/full/400,291/0/default.jpg
new file mode 100644
index 00000000..6d2433df
Binary files /dev/null and b/test/data/iiif_3_0_sizes/full/400,291/0/default.jpg differ
diff --git a/test/data/iiif_3_0_sizes/full/6976,5074/0/default.jpg b/test/data/iiif_3_0_sizes/full/6976,5074/0/default.jpg
new file mode 100644
index 00000000..8e627bbc
Binary files /dev/null and b/test/data/iiif_3_0_sizes/full/6976,5074/0/default.jpg differ
diff --git a/test/data/iiif_3_0_sizes/full/800,582/0/default.jpg b/test/data/iiif_3_0_sizes/full/800,582/0/default.jpg
new file mode 100644
index 00000000..b574b541
Binary files /dev/null and b/test/data/iiif_3_0_sizes/full/800,582/0/default.jpg differ
diff --git a/test/data/iiif_3_0_sizes/info.json b/test/data/iiif_3_0_sizes/info.json
new file mode 100644
index 00000000..991f4280
--- /dev/null
+++ b/test/data/iiif_3_0_sizes/info.json
@@ -0,0 +1,15 @@
+{
+ "@context": "http://iiif.io/api/image/3/context.json",
+ "id": "http://localhost:8000/test/data/iiif_3_0_sizes",
+ "protocol": "http://iiif.io/api/image",
+ "width": 6976,
+ "height": 5074,
+ "profile": "level0",
+ "sizes" : [
+ {"width" : 400, "height" : 291},
+ {"width" : 800, "height" : 582},
+ {"width" : 1600, "height" : 1164},
+ {"width" : 3200, "height": 2328},
+ {"width" : 6976, "height": 5074}
+ ]
+}
diff --git a/test/data/iiif_3_0_tiled/0,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..a29c5568
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,0,512,512/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,0,512,512/256,256/0/default.jpg
new file mode 100644
index 00000000..edb856cc
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,0,512,512/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,0,775,1024/194,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,0,775,1024/194,256/0/default.jpg
new file mode 100644
index 00000000..be76af06
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,0,775,1024/194,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..cb38ba74
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..0b44da15
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,512,512,512/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,512,512,512/256,256/0/default.jpg
new file mode 100644
index 00000000..250e76d1
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,512,512,512/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/0,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/0,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..8cf078fa
Binary files /dev/null and b/test/data/iiif_3_0_tiled/0,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/256,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/256,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..36ecb717
Binary files /dev/null and b/test/data/iiif_3_0_tiled/256,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/256,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/256,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..b57469a8
Binary files /dev/null and b/test/data/iiif_3_0_tiled/256,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/256,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/256,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..7fd76a78
Binary files /dev/null and b/test/data/iiif_3_0_tiled/256,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/256,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/256,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..cf96a405
Binary files /dev/null and b/test/data/iiif_3_0_tiled/256,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..ca605428
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,0,263,512/132,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,0,263,512/132,256/0/default.jpg
new file mode 100644
index 00000000..ca48f792
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,0,263,512/132,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..41dd14bb
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..1b42d53c
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,512,263,512/132,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,512,263,512/132,256/0/default.jpg
new file mode 100644
index 00000000..baa4ee5d
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,512,263,512/132,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/512,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled/512,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..b3e0f5cb
Binary files /dev/null and b/test/data/iiif_3_0_tiled/512,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/768,0,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled/768,0,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..7f08427a
Binary files /dev/null and b/test/data/iiif_3_0_tiled/768,0,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/768,256,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled/768,256,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..b21f307b
Binary files /dev/null and b/test/data/iiif_3_0_tiled/768,256,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/768,512,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled/768,512,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..4a92be8c
Binary files /dev/null and b/test/data/iiif_3_0_tiled/768,512,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/768,768,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled/768,768,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..f167fa29
Binary files /dev/null and b/test/data/iiif_3_0_tiled/768,768,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/1,/0/default.jpg b/test/data/iiif_3_0_tiled/full/1,/0/default.jpg
new file mode 100644
index 00000000..6b3670c8
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/1,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/13,/0/default.jpg b/test/data/iiif_3_0_tiled/full/13,/0/default.jpg
new file mode 100644
index 00000000..f9cb6979
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/13,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/2,/0/default.jpg b/test/data/iiif_3_0_tiled/full/2,/0/default.jpg
new file mode 100644
index 00000000..a335cd34
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/2,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/25,/0/default.jpg b/test/data/iiif_3_0_tiled/full/25,/0/default.jpg
new file mode 100644
index 00000000..18a43a03
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/25,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/4,/0/default.jpg b/test/data/iiif_3_0_tiled/full/4,/0/default.jpg
new file mode 100644
index 00000000..ce882561
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/4,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/49,/0/default.jpg b/test/data/iiif_3_0_tiled/full/49,/0/default.jpg
new file mode 100644
index 00000000..68b8eb9c
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/49,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/7,/0/default.jpg b/test/data/iiif_3_0_tiled/full/7,/0/default.jpg
new file mode 100644
index 00000000..4c234847
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/7,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/full/97,/0/default.jpg b/test/data/iiif_3_0_tiled/full/97,/0/default.jpg
new file mode 100644
index 00000000..4afad0bf
Binary files /dev/null and b/test/data/iiif_3_0_tiled/full/97,/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled/info.json b/test/data/iiif_3_0_tiled/info.json
new file mode 100644
index 00000000..b9e2473e
--- /dev/null
+++ b/test/data/iiif_3_0_tiled/info.json
@@ -0,0 +1,11 @@
+{
+ "@context": "http://iiif.io/api/image/3/context.json",
+ "id": "http://localhost:8000/test/data/iiif_3_0_tiled",
+ "protocol": "http://iiif.io/api/image",
+ "height": 1024,
+ "width": 775,
+ "tiles" : [{"width":256, "scaleFactors":[1,2,4,8]}],
+ "profile": "level2",
+ "extraQualities": ["bitonal", "grey", "color"],
+ "extraFormats": ["jpg", "png", "gif" ]
+}
diff --git a/test/data/iiif_3_0_tiled_sf1/0,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/0,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..a29c5568
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/0,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/0,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/0,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..cb38ba74
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/0,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/0,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/0,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..0b44da15
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/0,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/0,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/0,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..8cf078fa
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/0,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/256,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/256,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..36ecb717
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/256,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/256,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/256,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..b57469a8
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/256,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/256,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/256,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..7fd76a78
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/256,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/256,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/256,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..cf96a405
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/256,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/512,0,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/512,0,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..ca605428
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/512,0,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/512,256,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/512,256,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..41dd14bb
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/512,256,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/512,512,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/512,512,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..1b42d53c
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/512,512,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/512,768,256,256/256,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/512,768,256,256/256,256/0/default.jpg
new file mode 100644
index 00000000..b3e0f5cb
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/512,768,256,256/256,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/768,0,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/768,0,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..7f08427a
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/768,0,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/768,256,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/768,256,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..b21f307b
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/768,256,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/768,512,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/768,512,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..4a92be8c
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/768,512,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/768,768,7,256/7,256/0/default.jpg b/test/data/iiif_3_0_tiled_sf1/768,768,7,256/7,256/0/default.jpg
new file mode 100644
index 00000000..f167fa29
Binary files /dev/null and b/test/data/iiif_3_0_tiled_sf1/768,768,7,256/7,256/0/default.jpg differ
diff --git a/test/data/iiif_3_0_tiled_sf1/info.json b/test/data/iiif_3_0_tiled_sf1/info.json
new file mode 100644
index 00000000..8bb37a4e
--- /dev/null
+++ b/test/data/iiif_3_0_tiled_sf1/info.json
@@ -0,0 +1,11 @@
+{
+ "@context": "http://iiif.io/api/image/3/context.json",
+ "id": "http://localhost:8000/test/data/iiif_3_0_tiled_sf1",
+ "protocol": "http://iiif.io/api/image",
+ "height": 1024,
+ "width": 775,
+ "tiles" : [{"width": 256, "scaleFactors": [1]}],
+ "profile": "level2",
+ "extraQualities": ["bitonal", "grey", "color"],
+ "extraFormats": ["jpg", "png", "gif" ]
+}
diff --git a/test/modules/formats.js b/test/modules/formats.js
index b14a5680..867bcd17 100644
--- a/test/modules/formats.js
+++ b/test/modules/formats.js
@@ -151,6 +151,20 @@
'}', assert);
});
+ QUnit.test('IIIF 3.0 JSON', function(assert) {
+ testOpenUrl('iiif_3_0_tiled/info.json', assert);
+ });
+
+ // ----------
+ QUnit.test('IIIF 3.0 JSON scaleFactors [1]', function(assert) {
+ testOpenUrl('iiif_3_0_tiled_sf1/info.json', assert);
+ });
+
+ // ----------
+ QUnit.test('IIIF 3.0 JSON, sizes array only', function(assert) {
+ testOpenUrl('iiif_3_0_sizes/info.json', assert);
+ });
+
// ----------
QUnit.test('ImageTileSource', function(assert) {
testOpen({
diff --git a/test/modules/iiif.js b/test/modules/iiif.js
index 3c98e24b..cc5035b7 100644
--- a/test/modules/iiif.js
+++ b/test/modules/iiif.js
@@ -143,7 +143,9 @@
"profile": "level1"
};
- QUnit.test('IIIFTileSource.configure determins correct version', function(assert) {
+ QUnit.module('IIIF');
+
+ QUnit.test('IIIFTileSource.configure determines correct version', function(assert) {
var options1_0xml = configure(infoXml10level0);
assert.ok(options1_0xml.version);
assert.equal(options1_0xml.version, 1, 'Version is 1 for version 1.0 info.xml');
diff --git a/test/test.html b/test/test.html
index c1fede18..b113626d 100644
--- a/test/test.html
+++ b/test/test.html
@@ -26,6 +26,7 @@
+
@@ -46,7 +47,6 @@
-