mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
If there is an error rendering the cover thumbnail report it to the GUI with thumb=None
This commit is contained in:
parent
f97147afec
commit
6f82b8e36c
@ -915,21 +915,21 @@ class GridView(QListView):
|
||||
return
|
||||
if self.ignore_render_requests.is_set():
|
||||
continue
|
||||
thumb = None
|
||||
try:
|
||||
# Fetch the cover from the cache or file system
|
||||
cover_tuple = self.fetch_cover_from_cache(book_id)
|
||||
|
||||
# Render/resize the cover.
|
||||
thumb = self.make_thumbnail(cover_tuple)
|
||||
|
||||
# Tell the GUI to redisplay the cover. These can queue, but
|
||||
# the work is limited to painting the cover if it is visible
|
||||
# so there shouldn't be much performance lag. Using a
|
||||
# dispatcher to eliminate the queue would probably be worse.
|
||||
self.update_item.emit(book_id, thumb)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
# Tell the GUI to redisplay the cover. These can queue, but
|
||||
# the work is limited to painting the cover if it is visible
|
||||
# so there shouldn't be much performance lag. Using a
|
||||
# dispatcher to eliminate the queue would probably be worse.
|
||||
self.update_item.emit(book_id, thumb)
|
||||
|
||||
finally:
|
||||
q.task_done()
|
||||
|
||||
@ -1004,7 +1004,7 @@ class GridView(QListView):
|
||||
cdata = cover_tuple.cdata
|
||||
book_id = cover_tuple.book_id
|
||||
tc = self.thumbnail_cache
|
||||
# thumb = None
|
||||
thumb = None
|
||||
if cover_tuple.has_cover:
|
||||
# cdata contains either the resized thumbnail, the full cover.jpg,
|
||||
# or None if cover.jpg isn't valid
|
||||
|
Loading…
x
Reference in New Issue
Block a user