We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c53beb6 commit 5c489f1Copy full SHA for 5c489f1
plugins/addimage.js
@@ -233,8 +233,16 @@
233
, notDefined = function(value) {
234
return typeof value === 'undefined' || value === null || value.length === 0;
235
}
236
- , generateAliasFromData = function(data) {
237
- return typeof data === 'string' && jsPDFAPI.sHashCode(data);
+ , generateAliasFromData = function(imageData) {
+ if (typeof imageData === 'string') {
238
+ return jsPDFAPI.sHashCode(imageData);
239
+ }
240
+
241
+ if (jsPDFAPI.isArrayBufferView(imageData)) {
242
+ return jsPDFAPI.sHashCode(jsPDFAPI.arrayBufferToBinaryString(imageData));
243
244
245
+ return null;
246
247
, isImageTypeSupported = function(type) {
248
return (typeof jsPDFAPI["process" + type.toUpperCase()] === "function");
0 commit comments