mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 00:26:10 +03:00
IE8 fix for tileSources type: 'image'
This commit is contained in:
parent
254b426b2b
commit
c5ad9b25bf
@ -73,6 +73,13 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* IE8 fix for tileSources type: 'image' */
|
||||||
|
$.getNatural = function (DOMelement) {
|
||||||
|
var img = new Image();
|
||||||
|
img.src = DOMelement.src;
|
||||||
|
return { width: img.width, height: img.height };
|
||||||
|
};
|
||||||
|
|
||||||
$.extend($.ImageTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.ImageTileSource.prototype */{
|
$.extend($.ImageTileSource.prototype, $.TileSource.prototype, /** @lends OpenSeadragon.ImageTileSource.prototype */{
|
||||||
/**
|
/**
|
||||||
* Determine if the data and/or url imply the image service is supported by
|
* Determine if the data and/or url imply the image service is supported by
|
||||||
@ -114,8 +121,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.addEvent(image, 'load', function () {
|
$.addEvent(image, 'load', function () {
|
||||||
_this.width = image.naturalWidth;
|
_this.width = $.getNatural(image).width;
|
||||||
_this.height = image.naturalHeight;
|
_this.height = $.getNatural(image).height;
|
||||||
_this.aspectRatio = _this.width / _this.height;
|
_this.aspectRatio = _this.width / _this.height;
|
||||||
_this.dimensions = new $.Point(_this.width, _this.height);
|
_this.dimensions = new $.Point(_this.width, _this.height);
|
||||||
_this._tileWidth = _this.width;
|
_this._tileWidth = _this.width;
|
||||||
@ -202,8 +209,8 @@
|
|||||||
_buildLevels: function () {
|
_buildLevels: function () {
|
||||||
var levels = [{
|
var levels = [{
|
||||||
url: this._image.src,
|
url: this._image.src,
|
||||||
width: this._image.naturalWidth,
|
width: $.getNatural(this._image).width,
|
||||||
height: this._image.naturalHeight
|
height: $.getNatural(this._image).height
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {
|
if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {
|
||||||
|
Loading…
Reference in New Issue
Block a user