Bug 119112 - [EPUB] SVG images are rendered duplicated
Summary: [EPUB] SVG images are rendered duplicated
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.2 rc
Hardware: All All
: high major
Assignee: Julien Nabet
URL:
Whiteboard: target:26.8.0
Keywords: implementationError
Depends on:
Blocks: Writer-Images EPUB-Export
  Show dependency treegraph
 
Reported: 2018-08-05 15:00 UTC by Olivier Hallot
Modified: 2026-05-30 17:22 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Source file for EPUB export with issue (29.33 KB, application/vnd.oasis.opendocument.text)
2018-08-05 15:00 UTC, Olivier Hallot
Details
Resulto of EPUB export, with dup image (11.39 KB, application/epub+zip)
2018-08-05 15:01 UTC, Olivier Hallot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Hallot 2018-08-05 15:00:38 UTC
Created attachment 143983 [details]
Source file for EPUB export with issue

SVG Images are duplicated in EPUB export

Step to reproduce:

1) Add SVG image in the document
2) add caption, or not
3) export to EPUB

Expected result: Image exported with caption

Actual results: Exported image are duplicated.

The attached ODT document shows the issue. Export to EPUB and open in Calibre.
Comment 1 Olivier Hallot 2018-08-05 15:01:31 UTC
Created attachment 143984 [details]
Resulto of EPUB export, with dup image
Comment 2 Roman Kuznetsov 2018-08-06 19:12:49 UTC
confirmed in

Version: 6.1.0.2
Build ID: b3972dcf1284967612d5ee04fea9d15bcf0cc106
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: ru-RU (ru_RU.UTF-8); Calc: group threaded
Comment 3 Ysabeau 2018-09-27 08:20:05 UTC
Confirmed in 

Version: 6.1.1.2
Build ID: 5d19a1bfa650b796764388cd8b33a5af1f5baa1b
Threads CPU : 4; OS : Linux 4.14; UI Render : par défaut; VCL: kde4;
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 4 ribotb 2018-09-27 12:03:13 UTC
Confirmed with

Version: 6.2.0.0.alpha0+ (x64)
Build ID: efd316b6171b9e1827c5e34ddb12658f48268e24
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2018-09-05_11:26:52
Locale: fr-FR (fr_FR); Calc: threaded

Bernard
Comment 5 QA Administrators 2019-09-28 03:04:43 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2021-09-28 05:16:48 UTC Comment hidden (obsolete)
Comment 7 Roman Kuznetsov 2021-10-02 07:46:32 UTC
still repro in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: fbfd91f2c5f4d66570c2d5a6f048b21f5d1671a4
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 8 Ysabeau 2021-10-04 15:12:54 UTC
Stil in Version: 7.2.1.2 / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 9 Christina Rossmanith 2021-10-12 12:29:11 UTC
I've unzipped the exported epub. sectionXXXX.xhtml has <img> tags for both the svg and the png version of the same image file. That is why they show up twice.

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 77fca82aab16619a693d53e970ac717f54105e95
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
Comment 10 Sophie Sipasseuth 2023-10-12 13:03:49 UTC
When I export in Epub the file, and then, open it in Writer, two messages of error appear.
The first one explains the file is corrupted.
After I put Yes to fix it.
The second one explains the file cannot be opened.

I tried a second time with another file, the bug is still present.


Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9a02f4ed071f15908624fb1cafcf6dbb72b00a1b
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 11 Sophie Sipasseuth 2023-10-12 13:09:34 UTC
I tried one last time with an Epub file from the Internet, and the problem is the same.
Comment 12 stragu 2023-11-06 11:04:25 UTC
Started when images in EPUB started in 6.1, so marking as an implementation error.
Comment 13 QA Administrators 2025-11-06 03:12:40 UTC Comment hidden (obsolete)
Comment 14 Ysabeau 2025-11-06 07:54:20 UTC
Still in 25.8.2.2.

If you open the epub file in Sigil: you see it embeds a SVG and a PNG and both are on the EPUB file, while, when you use the extension Writer2xhtml it only has a SVG file.
Comment 15 Ysabeau 2025-11-06 13:56:42 UTC
Oh, and I forget to precise that Writer2xhtml makes a better EPUB than the feature of LibreOffice.
Comment 16 Julien Nabet 2026-05-26 21:41:18 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Taking a look at the content of the epub file generated, each svg has also a png. I think it's a kind of fallback mechanism.
So the next steps are:
- locate where is the fallback mechanism
- how to disable it only in this case
I'm not sure but I think it's a generic mechanism so perhaps it's needed in some other cases.
Comment 17 Julien Nabet 2026-05-28 09:47:40 UTC
https://gerrit.libreoffice.org/c/core/+/205807
Comment 18 Commit Notification 2026-05-28 15:33:29 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dd769ab47fe4215685bb2d8a58efe244af6a394d

tdf#119112: during epub export, each svg image appears twice

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Julien Nabet 2026-05-30 17:22:05 UTC
Let's put this one to RESOLVED.
If someone still reproduce this with a build including the patch, don't hesitate to reopen this tracker.