From e4bd874b03cba1e5419f4e9aee3e4534b02e237c Mon Sep 17 00:00:00 2001 From: Jon Stroop Date: Thu, 26 Sep 2013 17:24:02 -0400 Subject: [PATCH] added test for 1.1; renamed 11 to 1_1 --- Gruntfile.js | 2 +- ...if11tilesource.js => iiif1_1tilesource.js} | 12 ++++----- test/data/iiif1_1.json | 27 +++++++++++++++++++ test/formats.js | 7 +++++ 4 files changed, 41 insertions(+), 7 deletions(-) rename src/{iiif11tilesource.js => iiif1_1tilesource.js} (94%) create mode 100644 test/data/iiif1_1.json diff --git a/Gruntfile.js b/Gruntfile.js index ce91ac8a..419752e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -34,7 +34,7 @@ module.exports = function(grunt) { "src/tilesource.js", "src/dzitilesource.js", "src/iiiftilesource.js", - "src/iiif11tilesource.js", + "src/iiif1_1tilesource.js", "src/osmtilesource.js", "src/tmstilesource.js", "src/legacytilesource.js", diff --git a/src/iiif11tilesource.js b/src/iiif1_1tilesource.js similarity index 94% rename from src/iiif11tilesource.js rename to src/iiif1_1tilesource.js index 98fe722b..6e022d3b 100644 --- a/src/iiif11tilesource.js +++ b/src/iiif1_1tilesource.js @@ -1,5 +1,5 @@ /* - * OpenSeadragon - IIIF11TileSource + * OpenSeadragon - IIIF1_1TileSource * * Copyright (C) 2009 CodePlex Foundation * Copyright (C) 2010-2013 OpenSeadragon contributors @@ -43,7 +43,7 @@ * @extends OpenSeadragon.TileSource * @see http://library.stanford.edu/iiif/image-api/ */ -$.IIIF11TileSource = function( options ){ +$.IIIF1_1TileSource = function( options ){ $.extend( true, this, options ); @@ -69,12 +69,12 @@ $.IIIF11TileSource = function( options ){ $.TileSource.apply( this, [ options ] ); }; -$.extend( $.IIIF11TileSource.prototype, $.TileSource.prototype, { +$.extend( $.IIIF1_1TileSource.prototype, $.TileSource.prototype, { /** * Determine if the data and/or url imply the image service is supported by * this tile source. * @function - * @name OpenSeadragon.IIIF11TileSource.prototype.supports + * @name OpenSeadragon.IIIF1_1TileSource.prototype.supports * @param {Object|Array} data * @param {String} optional - url */ @@ -91,7 +91,7 @@ $.extend( $.IIIF11TileSource.prototype, $.TileSource.prototype, { /** * * @function - * @name OpenSeadragon.IIIF11TileSource.prototype.configure + * @name OpenSeadragon.IIIF1_1TileSource.prototype.configure * @param {Object} data - the raw configuration */ // IIIF 1.1 Info Looks like this (XML syntax is no more): @@ -114,7 +114,7 @@ $.extend( $.IIIF11TileSource.prototype, $.TileSource.prototype, { * Responsible for retreiving the url which will return an image for the * region specified by the given x, y, and level components. * @function - * @name OpenSeadragon.IIIF11TileSource.prototype.getTileUrl + * @name OpenSeadragon.IIIF1_1TileSource.prototype.getTileUrl * @param {Number} level - z index * @param {Number} x * @param {Number} y diff --git a/test/data/iiif1_1.json b/test/data/iiif1_1.json new file mode 100644 index 00000000..5a33ce73 --- /dev/null +++ b/test/data/iiif1_1.json @@ -0,0 +1,27 @@ +{ + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "scale_factors": [ + 1, + 2, + 4, + 8, + 16 + ], + "tile_height": 256, + "height": 3600, + "width": 2584, + "tile_width": 256, + "qualities": [ + "native", + "bitonal", + "grey", + "color" + ], + "formats": [ + "jpg", + "png", + "gif" + ], + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "@id": "http://libimages.princeton.edu/loris/pudl0071%2F4055459%2F01%2F00000030.jp2" +} \ No newline at end of file diff --git a/test/formats.js b/test/formats.js index 0c673bcf..8258c386 100644 --- a/test/formats.js +++ b/test/formats.js @@ -65,4 +65,11 @@ testOpen('testpattern.xml'); }); + // ---------- + asyncTest('IIIF 1.1 JSON', function() { + testOpen('iiif1_1.json'); + }); + + + })();