EPUB -> MOBI conversion removes entire frontmatter, and also drops cover image

Bug #1746794 reported by jt on 2018-02-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

The ebook-convert EPUB -> MOBI conversion removes entire frontmatter, and also drops the cover image (calibre itself no longer shows a cover image in the book listing when marking the resulting .mobi file).

I did a test conversion with draft2digital.com which had none of those issues, so this appears to be a calibre bug.

Test file is attached.

Seen on calibre 3.12 / GNU/Linux Fedora 27 x64

frontmatter.xhtml is marked as a cover in the OPF. During conversion covers are
replaced. Make a separate cover.xhtml and mark that as your cover.

 status invalid

Changed in calibre:
status: New → Invalid
jt (jt1234567) wrote :

But with what is the cover replaced? It doesn't seem to be replaced but simply gone. The resulting .mobi not only lacks the frontmatter, but also any trace of a cover. Is this really intended?

jt (jt1234567) wrote :

Updated test EPUB where the cover simply disappears after conversion to MOBI. (front matter is now retained after separating it as you advised me to do)

Kovid Goyal (kovid) wrote :

It is replaced by whatever cover image you specified during conversion.
Which if you used the GUI is the cover you defined in calibre. If you
want to see the cover in the MOBI file open it in the calibre viewer or
use the Go to cover function on the Kindle.

jt (jt1234567) wrote :

Okay, a few more detailed steps of what I did and what I expected:

Step 1: Open book.epub (as attached) in calibre. You should see it show up in the list of the UI with a cover.

Step 2: Run this command: ebook-convert 'book.epub' 'book.mobi'

Step 3: Open book.mobi (as resulting from that command) in calibre. You should see it shows up *without* a cover. Also, if you open it in the calibre viewer, the navigation seems a bit confused and cover/frontmatter are highlighted at the same time when looking at the front matter.

Expected behavior: in the resulting mobi, the cover is still there

Actual behavior: cover seems to be gone, at least in calibre itself I can't see any trace of it

Kovid Goyal (kovid) wrote :

Look at the output from your ebook-convert command, in particular

Found an HTML cover: EPUB/frontmatter.xhtml removing it. If you find some content missing from the output MOBI, it is because you misidentified the HTML cover in the input document

Cover not in manifest, skipping.

TOC item Cover & Frontmatter [EPUB/frontmatter.xhtml] not found in document

Kovid Goyal (kovid) wrote :

I should note that there is an actual bug in the conversion which will cause it to not pick up the cover image from the input document -- caused by the use of <guide> which is deprecated in EPUB 3. That bug will be fixed in the next release. In the meantime, either remove the <guidfe> from your EPUB or specify the cover image using --cover manually

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
jt (jt1234567) wrote :

Yes, I used <guide> intentionally for EPUB2 backwards compatibility. I'm aware it's deprecated in EPUB3. Thanks for fixing it :-)

jt (jt1234567) wrote :

Is the problem with the strange TOC addressed as well? I just tried to test it, but I couldn't successfully build calibre due to a problem with pickle, and another issue with PyQt5.6 no longer including QtWebKitWidgets.

It looks like the cover HTML section is removed, but not from the TOC, resulting in an invalid TOC that also confuses the calibre viewer itself.

You dont need to build calibre to test the change:
https://manual.calibre-ebook.com/develop.html

jt (jt1234567) wrote :

The latest release on the website appears to be 3.16 which was before you made the fix. The page you linked mentions the git and "binary releases" but no link to newer development binary releases I can see. What do you want me to look at specifically?

Kovid Goyal (kovid) wrote :

Install 3.16, then checkout the git sources, then set
CALIBRE_DEVELOP_FROM, you're done.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers