Bulk Metadata "Set from ebook file(s)" when no cover image doesn't work

Bug #1374243 reported by Jim Miller on 2014-09-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

calibre version: 2.3[64bit]
Windows-8-6.2.9200 Windows

This is the case when there's no cover image and it should render the first page of each book.

To recreate, start with book(s) without covers, or remove covers from a few test books using Modify ePub. Do bulk metadata edit, choose Change Cover, Set from &ebook file(s).

cover_from_format in single metadata does this fine, as does calling calibre.ebooks.metadata.meta.get_metadata() from a plugin.

But args.cover_action == 'fromfmt' in metadata_bulk.py doesn't.

I've traced it down into calibre.ebooks.render_html(). There it checks calibre.gui2.is_ok_to_use_qt() which returns false, preventing the HTML render.

I wanted to offer a patch, but I'm too unclear what the best solution would be.

Qt can only be used in the main thread of the program, bulk metadata
runs in its own worker thread, thefre you have the issue.

What needs to be done is, if is_ok_to_use_qt() returns False, you have
to launch a worker process using fork_job() and render the cover in

If you wish to create a patch, fell free, otherwise I will get around
to it when I have some time.

Jim Miller (retiefjimm) wrote :

This patch works for me. Thanks for the pointer to fork_job.

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

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers