diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js index a18a9a2b..8c1da291 100644 --- a/src/iiiftilesource.js +++ b/src/iiiftilesource.js @@ -98,9 +98,9 @@ $.IIIFTileSource = function( options ){ } if ( !options.maxLevel ) { - if ( !this.scale_factors ) { - options.maxLevel = Number( Math.ceil( Math.log( Math.max( this.width, this.height ), 2 ) ) ); - } else { + if ( !this.scale_factors ) { + options.maxLevel = Number( Math.ceil( Math.log( Math.max( this.width, this.height ), 2 ) ) ); + } else { options.maxLevel = Math.floor( Math.pow( Math.max.apply(null, this.scale_factors), 0.5) ); } } @@ -128,7 +128,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea return true; // Version 1.0 - } else if ( data.profile && + } else if ( data.profile && data.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html") === 0) { return true; } else if ( data.identifier && data.width && data.height ) { @@ -166,7 +166,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea configure: function( data, url ){ // Try to deduce our version and fake it upwards if needed if ( !$.isPlainObject(data) ) { - var options = configureFromXml10( data ); + var options = configureFromXml10( data ); options['@context'] = "http://iiif.io/api/image/1.0/context.json"; options['@id'] = url.replace('/info.xml', ''); return options; diff --git a/src/tilesource.js b/src/tilesource.js index 9fc1f7d8..deecc742 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -263,7 +263,7 @@ $.TileSource.prototype = /** @lends OpenSeadragon.TileSource.prototype */{ tiles; for( i = this.minLevel; i < this.maxLevel; i++ ){ tiles = this.getNumTiles( i ); - tilesPerSide = Math.floor( Math.max( rect.x, rect.y ) / this.getTileSize(i) ); + tilesPerSide = Math.floor( Math.max( rect.x, rect.y ) / this.getTileSize(i) ); if( Math.max( tiles.x, tiles.y ) + 1 >= tilesPerSide ){ break; } diff --git a/src/viewport.js b/src/viewport.js index 7bceb9d8..38ecfa27 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -326,7 +326,7 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{ * @param {OpenSeadragon.Rect} bounds * @param {Boolean} immediately * @return {OpenSeadragon.Rect} constrained bounds. - */ + */ _applyBoundaryConstraints: function( bounds, immediately ) { var horizontalThreshold, verticalThreshold, @@ -402,9 +402,9 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{ this.viewer.raiseEvent( 'constrain', { immediately: immediately }); - } + } - return newBounds; + return newBounds; }, /** @@ -523,7 +523,7 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{ ); return this.zoomTo( newZoom, referencePoint, immediately ); - }, + }, /** * @function