aboutsummaryrefslogtreecommitdiff
path: root/lib/documents.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/documents.js')
-rw-r--r--lib/documents.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/documents.js b/lib/documents.js
index 67e98af..26c0ce7 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -152,6 +152,12 @@ function Image(options) {
return {
type: types.image,
read: options.readImage,
+ readAsText: function(encoding) {
+ if (!encoding) {
+ throw new Error("Missing encoding argument");
+ }
+ return options.readImage(encoding);
+ },
altText: options.altText,
contentType: options.contentType
};