Skip to content

Commit eb9dea5

Browse files
committed
Fixed #237
1 parent aec0c91 commit eb9dea5

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

jspdf.plugin.addimage.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,11 @@
325325
jsPDFAPI.isArrayBufferView = function(object) {
326326
if(!this.supportsArrayBuffer())
327327
return false;
328+
if(typeof Uint32Array === 'undefined')
329+
return false;
328330
return (object instanceof Int8Array ||
329331
object instanceof Uint8Array ||
330-
object instanceof Uint8ClampedArray ||
332+
(typeof Uint8ClampedArray !== 'undefined' && object instanceof Uint8ClampedArray) ||
331333
object instanceof Int16Array ||
332334
object instanceof Uint16Array ||
333335
object instanceof Int32Array ||

jspdf.plugin.png_support.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@
349349
img, dp, trns,
350350
colors, pal, smask;
351351

352-
if(this.isString(imageData)) {
352+
/* if(this.isString(imageData)) {
353353
354-
}
354+
}*/
355355

356356
if(this.isArrayBuffer(imageData))
357357
imageData = new Uint8Array(imageData);
@@ -511,7 +511,7 @@
511511
bpc, decode, imageIndex, alias, dp, trns, pal, smask);
512512
}
513513

514-
return info;
514+
throw new Error("Unsupported PNG image data, try using JPEG instead.");
515515
}
516516

517517
})(jsPDF.API)

libs/FileSaver.js

libs/polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,4 @@
186186
};
187187
}
188188

189-
})(self);
189+
})(this);

0 commit comments

Comments
 (0)