Skip to content

Commit 751772d

Browse files
committed
Merge pull request niklasvh#320 from oosterholt/master
Fixed IndexSizeError in IE when the size of the image exceedes 8192 pixels
2 parents 517fd8c + f61ceea commit 751772d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/renderers/Canvas.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ _html2canvas.Renderer.Canvas = function(options) {
115115
newCanvas.height = Math.ceil(bounds.height);
116116
ctx = newCanvas.getContext("2d");
117117

118-
ctx.drawImage(canvas, bounds.left, bounds.top, bounds.width, bounds.height, 0, 0, bounds.width, bounds.height);
118+
var imgData = canvas.getContext("2d").getImageData(bounds.left, bounds.top, bounds.width, bounds.height);
119+
ctx.putImageData(imgData, 0, 0);
120+
119121
canvas = null;
120122
return newCanvas;
121123
}
122124
}
123125

124126
return canvas;
125127
};
126-
};
128+
};

0 commit comments

Comments
 (0)