From d26b8b0ddf27543fecb7e40f3f734aad1e811d62 Mon Sep 17 00:00:00 2001 From: Manoj Singh Rawat Date: Fri, 22 Sep 2023 08:42:55 +0530 Subject: [PATCH 1/2] co-608: image fix --- src/service/print/getdocxdata.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/service/print/getdocxdata.js b/src/service/print/getdocxdata.js index c23f3e39..35d33a68 100644 --- a/src/service/print/getdocxdata.js +++ b/src/service/print/getdocxdata.js @@ -471,7 +471,7 @@ function createSAObject(data, count) { children: arr, }); } else if (data.image) { - if (data.image.includes("data:image/")) { + if (data.image.includes("data:")) { let image = getBufferImg(data.image); return new Paragraph({ @@ -551,6 +551,8 @@ function imageData(image) { return (bufferImage = image.replace("data:image/jpg;base64,", "")); } else if (image.includes("data:image/jpeg;base64")) { return (bufferImage = image.replace("data:image/jpeg;base64,", "")); + } else if (image.includes("data:application/octet-stream;base64")) { + return (bufferImage = image.replace("data:application/octet-stream;base64,", "")); } } From 2d0cad48d35f32a3f60688b7a1fc1cebe0bea8a0 Mon Sep 17 00:00:00 2001 From: Manoj Singh Rawat Date: Fri, 22 Sep 2023 16:24:18 +0530 Subject: [PATCH 2/2] co-608: image fix in option --- src/service/print/getdocxdata.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/print/getdocxdata.js b/src/service/print/getdocxdata.js index 35d33a68..b4bf3ae8 100644 --- a/src/service/print/getdocxdata.js +++ b/src/service/print/getdocxdata.js @@ -797,7 +797,7 @@ function displayOptions(option, height, width) { if (option !== undefined) { if (typeof option[1] === "object") { return displayOptionsObject(option[1]); - } else if (option[1].includes("data:image/")) { + } else if (option[1].includes("data:")) { let image = getBufferImg(option[1]); return new TableCell({ borders: MCQborder,