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

Bug #1374243 reported by Jim Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

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.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1374243

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
that.

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

Revision history for this message
Jim Miller (retiefjimm) wrote :

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

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.