From d6c3ccfd312420a0e0e76093dc051ba36bd62104 Mon Sep 17 00:00:00 2001 From: Rob Sanderson Date: Thu, 4 Sep 2014 12:04:31 -0700 Subject: [PATCH 1/2] scale_factors -> scaleFactors in 2.0 API --- src/iiiftilesource.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 8c1da291..c3c1fcd5 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -54,6 +54,7 @@ $.IIIFTileSource = function( options ){ options.tileSizePerScaleFactor = {}; + // N.B. 2.0 renamed scale_factors to scaleFactors if ( this.tile_width ) { options.tileSize = this.tile_width; } else if ( this.tile_height ) { @@ -62,13 +63,13 @@ $.IIIFTileSource = function( options ){ // Version 2.0 forwards if ( this.tiles.length == 1 ) { options.tileSize = this.tiles[0].width; - this.scale_factors = this.tiles[0].scale_factors; + this.scale_factors = this.tiles[0].scaleFactors; } else { // Multiple tile sizes at different levels this.scale_factors = []; for (var t = 0; t < this.tiles.length; t++ ) { - for (var sf = 0; sf < this.tiles[t].scale_factors.length; sf++) { - var scaleFactor = this.tiles[t].scale_factors[sf]; + for (var sf = 0; sf < this.tiles[t].scaleFactors.length; sf++) { + var scaleFactor = this.tiles[t].scaleFactors[sf]; this.scale_factors.push(scaleFactor); options.tileSizePerScaleFactor[scaleFactor] = this.tiles[t].width; } From 38da88c7948e954b6c63c7c636050b4735fbbaef Mon Sep 17 00:00:00 2001 From: Rob Sanderson Date: Thu, 4 Sep 2014 12:28:52 -0700 Subject: [PATCH 2/2] Fixing 2.0 test info.json --- test/data/iiif_2_0_tiled/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data/iiif_2_0_tiled/info.json b/test/data/iiif_2_0_tiled/info.json index 4cb0c3ab..d9b56f62 100644 --- a/test/data/iiif_2_0_tiled/info.json +++ b/test/data/iiif_2_0_tiled/info.json @@ -4,7 +4,7 @@ "protocol": "http://iiif.io/api/image", "height": 1024, "width": 775, - "tiles" : [{"width":256, "scale_factors":[1,2,4,8]}], + "tiles" : [{"width":256, "scaleFactors":[1,2,4,8]}], "profile": ["http://iiif.io/api/image/2/level1.json", {