Skip to content

Commit 53a89bf

Browse files
committed
addImage: imageData.clientWidth/Height might not be available
1 parent 186a55e commit 53a89bf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

jspdf.plugin.addimage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ jsPDFAPI.addImage = function(imageData, format, x, y, w, h) {
145145
}
146146
if (typeof imageData === 'object' && imageData.nodeType === 1) {
147147
var canvas = document.createElement('canvas');
148-
canvas.width = imageData.clientWidth;
149-
canvas.height = imageData.clientHeight;
148+
canvas.width = imageData.clientWidth || imageData.width;
149+
canvas.height = imageData.clientHeight || imageData.height;
150150

151151
var ctx = canvas.getContext('2d');
152152
if (!ctx) {

0 commit comments

Comments
 (0)