aboutsummaryrefslogtreecommitdiff
path: root/lib/document-to-html.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-05-14 13:39:33 +0100
committerMichael Williamson <mike@zwobble.org>2017-05-14 13:39:33 +0100
commit327b99803151111bcec37af0d2bc5df5baa3506b (patch)
tree6fddd7f45c42b3b123de5ec81ee56f4bcf537516 /lib/document-to-html.js
parentbdf33ea9172f3c32f42197135053e932f725fd91 (diff)
Extract data URI image converter to images module
Diffstat (limited to 'lib/document-to-html.js')
-rw-r--r--lib/document-to-html.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js
index 3a30ed2..d56ad1d 100644
--- a/lib/document-to-html.js
+++ b/lib/document-to-html.js
@@ -181,14 +181,6 @@ function DocumentConversion(options, comments) {
}
}
- var defaultConvertImage = images.imgElement(function(element) {
- return element.read("base64").then(function(imageBuffer) {
- return {
- src: "data:" + element.contentType + ";base64," + imageBuffer
- };
- });
- });
-
function recoveringConvertImage(convertImage) {
return function(image, messages) {
return promises.attempt(function() {
@@ -362,7 +354,7 @@ function DocumentConversion(options, comments) {
},
"commentReference": convertCommentReference,
"comment": convertComment,
- "image": deferredConversion(recoveringConvertImage(options.convertImage || defaultConvertImage)),
+ "image": deferredConversion(recoveringConvertImage(options.convertImage || images.dataUri)),
"table": convertTable,
"tableRow": convertTableRow,
"tableCell": convertTableCell,