mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Save the context of the full image as well.
This commit is contained in:
parent
37ca9235f8
commit
0c75b45075
@ -234,12 +234,8 @@
|
||||
return levels;
|
||||
}
|
||||
|
||||
var currentWidth = Math.floor(image.naturalWidth / 2);
|
||||
var currentHeight = Math.floor(image.naturalHeight / 2);
|
||||
|
||||
if (currentWidth < minWidth || currentHeight < minHeight) {
|
||||
return levels;
|
||||
}
|
||||
var currentWidth = image.naturalWidth;
|
||||
var currentHeight = image.naturalHeight;
|
||||
|
||||
var bigCanvas = document.createElement("canvas");
|
||||
var bigContext = bigCanvas.getContext("2d");
|
||||
@ -247,16 +243,12 @@
|
||||
bigCanvas.width = currentWidth;
|
||||
bigCanvas.height = currentHeight;
|
||||
bigContext.drawImage(image, 0, 0, currentWidth, currentHeight);
|
||||
levels[0].context2D = bigContext;
|
||||
|
||||
if ($.isCanvasTainted(bigContext.canvas)) {
|
||||
// If the canvas is tainted, we can't compute the pyramid.
|
||||
return levels;
|
||||
}
|
||||
levels.splice(0, 0, {
|
||||
context2D: bigContext,
|
||||
width: currentWidth,
|
||||
height: currentHeight
|
||||
});
|
||||
|
||||
while (currentWidth >= minWidth * 2 && currentHeight >= minHeight * 2) {
|
||||
currentWidth = Math.floor(currentWidth / 2);
|
||||
|
Loading…
Reference in New Issue
Block a user