Bug 119539 - FILESAVE: Custom cover image not shown in exported EPUB file (some viewers need cover metadata)
Summary: FILESAVE: Custom cover image not shown in exported EPUB file (some viewers ne...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: EPUB-Export
  Show dependency treegraph
 
Reported: 2018-08-27 16:28 UTC by Kriton Kyrimis
Modified: 2024-03-06 06:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
EPUB file as exported from Writer (7.13 KB, application/epub+zip)
2018-08-27 16:28 UTC, Kriton Kyrimis
Details
Hand-edited EPUB file (8.25 KB, application/epub+zip)
2018-08-27 16:29 UTC, Kriton Kyrimis
Details
Screenshot showing thumbnails of the two EPUB files (106.94 KB, image/jpeg)
2018-08-28 15:10 UTC, Kriton Kyrimis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kriton Kyrimis 2018-08-27 16:28:50 UTC
Created attachment 144482 [details]
EPUB file as exported from Writer

If I specify a custom cover image when exporting a document in EPUB format (using default values for all other options), the cover is not shown in my viewer (EBookDroid) on my tablet.

Comparing the generated code with an EPUB document where the cover is shown, I see that there is a missing
<meta name="cover" content="image0001" />
tag in the metadata section of OEBPS/content.opf, where image0001 is the id of the cover image.

If I add the missing tag, the cover is shown in the viewer.

Compare attached bad.epub (as exported from Writer) and fixed.epub (where I added the missing tag by hand).
Comment 1 Kriton Kyrimis 2018-08-27 16:29:44 UTC
Created attachment 144483 [details]
Hand-edited EPUB file
Comment 2 Dieter 2018-08-28 14:29:59 UTC
Couldn't see any differences between those two files, when I opened them with Edge-Browser.
Comment 3 Kriton Kyrimis 2018-08-28 15:10:39 UTC
Created attachment 144516 [details]
Screenshot showing thumbnails of the two EPUB files

(In reply to Dieter Praas from comment #2)
> Couldn't see any differences between those two files, when I opened them
> with Edge-Browser.

Which two files? the two EPUB files or the OEBPS/content.opf file contained in the two EPUB files?

If the former, in which case Edge acts as an EPUB reader, you shouldn't see any difference; you should simply see the single page of the document, which is the same in both EPUB files.

If the latter, in which case Edge acts as an XML viewer, search for
<meta name="cover" content="image0001" />
in fixed.epub's OEBPS/content.opf, which is not present in bad.epub's OEBPS/content.opf.

Check the attached screen shot from EBookDroid on my tablet. It shows the books in a folder. For fixed.epub it shows a thumbnail of the cover. For bad.epub, it shows a thumbnail of the first page of the document.
Comment 4 Kriton Kyrimis 2018-08-28 15:38:54 UTC
From what I've read about covers in EPUB files, although it appears that the cover's entry in the manifest is enough information to identify it as such, the meta tag must also be present.

In addition, for an EPUB file to be compatible withe Apple's iBooks application, a guide section must also be present, with the cover specified there, as well. At the moment, writer does not produce a guide section.

Check, e.g., https://wiki.mobileread.com/wiki/Ebook_Covers
Comment 5 Buovjaga 2018-09-23 13:49:15 UTC
I imported both books separately to Calibre. For both, it shows "You can't judge a book by its cover" as the cover image.

Anyway, as this clearly affects some viewers and the fix is known, I'll set to NEW
Comment 6 QA Administrators 2019-09-24 03:10:22 UTC Comment hidden (obsolete)
Comment 7 Kriton Kyrimis 2019-09-24 04:17:06 UTC
The bug is still present in:

Version: 6.3.2.2
Build ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU threads: 2; OS: Linux 5.2; UI render: default; VCL: kde5; 
Locale: el-GR (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 8 Andrew Hall 2022-03-06 22:43:30 UTC
(I know this sounds like a bug in the Overdrive app, but...read on please.)

I have found that in the Overdrive ereader app, the Cover image file in the Epub file must contain the word "cover" in the filename.  Otherwise, the cover thumbnail will not be generated in Overdrive.

I verified this using the Sigil app to create a clean Epub file.  First I created a cover with a generic image name, say image. jpg.  Overdrive will not show the cover.  Then I changed the name to "image_cover.jpg" and Overdrive renders the cover thumbnail without issue.

Libreoffice changes the name of the custom cover image (to image0001.jpg) no matter what the original was called, perhaps to avoid any possible illegal file names.  But if I use a custom cover image, I have to edit the Epub file later (with Sigil) to fix the cover.

Yes, perhaps Overdrive has a bug, but given that every other Epub file I've read over the last few years has the cover image named with "cover" in the file name, it must be some sort of standard, de facto or otherwise.

Best behavior for Writer is perhaps to rename the cover image to image0001_cover.jpg instead of just image0001.jpg.
Comment 9 QA Administrators 2024-03-06 03:14:18 UTC Comment hidden (obsolete)
Comment 10 Kriton Kyrimis 2024-03-06 06:55:41 UTC
Yes, the problem is still there in:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+xcb)
Locale: el-GR (en_US.UTF-8); UI: en-US
Calc: threaded