diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-05-28 11:44:46 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-05-28 11:44:46 +0100 |
| commit | 2b87c2e4a31f80c467af1c5db0e9da3a6e1e508d (patch) | |
| tree | 69819cb306b820ffc12599ed6b7505878d8e5de5 /lib/documents.js | |
| parent | 0d60c148c8fdb8168dcc6402021639572243f9cd (diff) | |
Introduce readAsText() on Image
Diffstat (limited to 'lib/documents.js')
| -rw-r--r-- | lib/documents.js | 6 |
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 }; |
