From 493b0ebccaebd23cf7dc1c20486311bdfd0366be Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 2 Dec 2021 17:34:27 +0100 Subject: [PATCH] Fix missing images when exporting a presentation --- www/common/onlyoffice/inner.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index b220790a1..3829de949 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1546,6 +1546,16 @@ define([ }); var type = common.getMetadataMgr().getPrivateData().ooType; var images = (e && window.frames[0].AscCommon.g_oDocumentUrls.urls) || {}; + + // Fix race condition which could drop images sometimes + // ==> make sure each image has a 'media/image_name.ext' entry as well + Object.keys(images).forEach(function (img) { + if (/^media\//.test(img)) { return; } + if (images['media/'+img]) { return; } + images['media/'+img] = images[img]; + }); + + // Add theme images var theme = e && window.frames[0].AscCommon.g_image_loader.map_image_index; if (theme) { Object.keys(theme).forEach(function (url) { @@ -1554,6 +1564,7 @@ define([ } }); } + sframeChan.query('Q_OO_CONVERT', { data: data, type: type,