From 327b99803151111bcec37af0d2bc5df5baa3506b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 14 May 2017 13:39:33 +0100 Subject: Extract data URI image converter to images module --- lib/document-to-html.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/document-to-html.js') 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, -- cgit v1.2.3