mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +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 */{
|
||||
/**
|
||||
* Determine if the data and/or url imply the image service is supported by
|
||||
@ -114,8 +121,8 @@
|
||||
}
|
||||
|
||||
$.addEvent(image, 'load', function () {
|
||||
_this.width = image.naturalWidth;
|
||||
_this.height = image.naturalHeight;
|
||||
_this.width = $.getNatural(image).width;
|
||||
_this.height = $.getNatural(image).height;
|
||||
_this.aspectRatio = _this.width / _this.height;
|
||||
_this.dimensions = new $.Point(_this.width, _this.height);
|
||||
_this._tileWidth = _this.width;
|
||||
@ -202,8 +209,8 @@
|
||||
_buildLevels: function () {
|
||||
var levels = [{
|
||||
url: this._image.src,
|
||||
width: this._image.naturalWidth,
|
||||
height: this._image.naturalHeight
|
||||
width: $.getNatural(this._image).width,
|
||||
height: $.getNatural(this._image).height
|
||||
}];
|
||||
|
||||
if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) {
|
||||
|
Loading…
Reference in New Issue
Block a user