Skip to content

Commit 029b96a

Browse files
committed
applied proposals of #267 by @diegocr
1 parent fb3c7df commit 029b96a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jspdf.plugin.addimage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@
174174

175175
if(element.nodeName === 'CANVAS') {
176176
var canvas = element;
177-
//if already a supported data url image, just return the dataurl
178-
} else if (element.getAttribute('src').indexOf('data:image/') === 0) {
177+
//if element is an image which uses data url defintion, just return the dataurl
178+
} else if (element.nodeName === 'IMG' && element.getAttribute('src') && element.getAttribute('src').indexOf('data:image/') === 0) {
179179
return element.getAttribute('src');
180180
} else {
181181
var canvas = document.createElement('canvas');

jspdf.plugin.from_html.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@
438438
if (img.width + img.height) {
439439
images[url] = images[url] || img;
440440
}
441-
if(!--x) {
442-
done();
443-
}
441+
}
442+
if(!--x) {
443+
done();
444444
}
445445
};
446446
img.src = url;

0 commit comments

Comments
 (0)