diff --git a/changelog.txt b/changelog.txt index d1e02b23..70efa878 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,9 @@ OPENSEADRAGON CHANGELOG * Fix for IIPServer-style urls when using DZI (#413) * Fix memory leak while destroying the viewer (#421) * Added fitBoundsWithConstraints() to the viewport (#423) +* New combined IIIF TileSource for 1.0 through 2.0 (#441) +* Allowed TileSources to have dynamic tileSize via source.getTileSize(level) (#441) + 1.1.1: diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index 73deba73..c529870b 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -1,6 +1,7 @@ /* * OpenSeadragon - IIIFMultiTileSource * + * Copyright (C) 2009 CodePlex Foundation * Copyright (C) 2010-2013 OpenSeadragon contributors * * Redistribution and use in source and binary forms, with or without @@ -42,7 +43,7 @@ * @extends OpenSeadragon.TileSource * @see http://iiif.io/api/image/ */ -$.IIIFMultiTileSource = function( options ){ +$.IIIFTileSource = function( options ){ $.extend( true, this, options ); @@ -107,7 +108,7 @@ $.IIIFMultiTileSource = function( options ){ $.TileSource.apply( this, [ options ] ); }; -$.extend( $.IIIFMultiTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.IIIFMultiTileSource.prototype */{ +$.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.IIIFTileSource.prototype */{ /** * Determine if the data and/or url imply the image service is supported by * this tile source. @@ -148,7 +149,7 @@ $.extend( $.IIIFMultiTileSource.prototype, $.TileSource.prototype, /** @lends Op * * @function * @param {Object} data - the raw configuration - * @example IIIF 1.1 Info Looks like this (XML syntax is no more) + * @example IIIF 1.1 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", @@ -178,6 +179,12 @@ $.extend( $.IIIFMultiTileSource.prototype, $.TileSource.prototype, /** @lends Op } }, + /** + * Return the tileSize for the given level. + * @function + * @param {Number} level + */ + getTileSize: function( level ){ var scaleFactor = Math.pow(2, this.maxLevel - level); // cache it in case any external code is going to read it directly diff --git a/src/tilesource.js b/src/tilesource.js index bcb553fb..9fc1f7d8 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -127,6 +127,8 @@ $.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLeve */ /** * The size of the image tiles used to compose the image. + * Please note that tileSize may be deprecated in a future release. + * Instead the getTileSize(level) function should be used. * @member {Number} tileSize * @memberof OpenSeadragon.TileSource# */ @@ -195,6 +197,10 @@ $.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLeve $.TileSource.prototype = /** @lends OpenSeadragon.TileSource.prototype */{ /** + * Return the tileSize for a given level. + * Subclasses should override this if tileSizes can be different at different levels + * such as in IIIFTileSource. Code should use this function rather than reading + * from .tileSize directly. tileSize may be deprecated in a future release. * @function * @param {Number} level */