aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-05-28 19:05:05 +0100
committerMichael Williamson <mike@zwobble.org>2023-05-28 19:05:05 +0100
commit82f8d243b6aba94bd9ed083f242f2470e00fc122 (patch)
tree1c673dc2ac16e293e3e659f1da35343f012d4469 /lib
parentb2b2c35715985f624e6b696fd87140fa6056318f (diff)
Support readAsBuffer() on images
Diffstat (limited to 'lib')
-rw-r--r--lib/documents.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/documents.js b/lib/documents.js
index 9088ed9..cc6a2a3 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -168,6 +168,11 @@ function Image(options) {
readAsBase64String: function() {
return options.readImage("base64");
},
+ readAsBuffer: function() {
+ return options.readImage().then(function(arrayBuffer) {
+ return Buffer.from(arrayBuffer);
+ });
+ },
altText: options.altText,
contentType: options.contentType
};