Permalink
Browse files

applied proposals of #267 by @diegocr

  • Loading branch information...
1 parent fb3c7df commit 029b96ab4704392fed975f45518018edeb0c46df @woolfg woolfg committed May 25, 2014
Showing with 5 additions and 5 deletions.
  1. +2 −2 jspdf.plugin.addimage.js
  2. +3 −3 jspdf.plugin.from_html.js
View
@@ -174,8 +174,8 @@
if(element.nodeName === 'CANVAS') {
var canvas = element;
- //if already a supported data url image, just return the dataurl
- } else if (element.getAttribute('src').indexOf('data:image/') === 0) {
+ //if element is an image which uses data url defintion, just return the dataurl
+ } else if (element.nodeName === 'IMG' && element.getAttribute('src') && element.getAttribute('src').indexOf('data:image/') === 0) {
return element.getAttribute('src');
} else {
var canvas = document.createElement('canvas');
@@ -438,9 +438,9 @@
if (img.width + img.height) {
images[url] = images[url] || img;
}
- if(!--x) {
- done();
- }
+ }
+ if(!--x) {
+ done();
}
};
img.src = url;

0 comments on commit 029b96a

Please sign in to comment.