Merge pull request #286 from jpstroop/master

Support IIIF servers that don't report tile dimensions
This commit is contained in:
iangilman 2013-11-19 10:59:06 -08:00
commit 40dd1d276b
11 changed files with 30 additions and 2 deletions

View File

@ -51,7 +51,12 @@ $.IIIF1_1TileSource = function( options ){
throw new Error('IIIF required parameters not provided.'); throw new Error('IIIF required parameters not provided.');
} }
if ( !(this.tile_width && this.tile_height) ) {
// use the short dimension if there aren't tile sizes provided.
options.tileSize = Math.min(this.height, this.width);
} else {
options.tileSize = this.tile_width; options.tileSize = this.tile_width;
}
if (! options.maxLevel ) { if (! options.maxLevel ) {
var mf = -1; var mf = -1;
@ -83,7 +88,6 @@ $.extend( $.IIIF1_1TileSource.prototype, $.TileSource.prototype, {
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0" == data.profile || "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0" == data.profile ||
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1" == data.profile || "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1" == data.profile ||
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2" == data.profile || "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2" == data.profile ||
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level3" == data.profile ||
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html" == data.profile "http://library.stanford.edu/iiif/image-api/1.1/compliance.html" == data.profile
); );
}, },

View File

@ -0,0 +1,19 @@
{
"profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",
"height": 850,
"width": 1024,
"qualities": [
"native",
"color",
"grey",
"bitonal"
],
"formats": [
"jpg",
"png",
"gif"
],
"@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json",
"@id": "http://localhost:8000/test/data/iiif_no_tiles"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 KiB

View File

@ -80,4 +80,9 @@
testOpen('iiif1_1.json'); testOpen('iiif1_1.json');
}); });
// ----------
asyncTest('IIIF No Tiles', function() {
testOpen('iiif_no_tiles.json');
});
})(); })();