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
|
return
|
||||||
if self.ignore_render_requests.is_set():
|
if self.ignore_render_requests.is_set():
|
||||||
continue
|
continue
|
||||||
|
thumb = None
|
||||||
try:
|
try:
|
||||||
# Fetch the cover from the cache or file system
|
# Fetch the cover from the cache or file system
|
||||||
cover_tuple = self.fetch_cover_from_cache(book_id)
|
cover_tuple = self.fetch_cover_from_cache(book_id)
|
||||||
|
|
||||||
# Render/resize the cover.
|
# Render/resize the cover.
|
||||||
thumb = self.make_thumbnail(cover_tuple)
|
thumb = self.make_thumbnail(cover_tuple)
|
||||||
|
except Exception:
|
||||||
# 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:
|
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
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:
|
finally:
|
||||||
q.task_done()
|
q.task_done()
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ class GridView(QListView):
|
|||||||
cdata = cover_tuple.cdata
|
cdata = cover_tuple.cdata
|
||||||
book_id = cover_tuple.book_id
|
book_id = cover_tuple.book_id
|
||||||
tc = self.thumbnail_cache
|
tc = self.thumbnail_cache
|
||||||
# thumb = None
|
thumb = None
|
||||||
if cover_tuple.has_cover:
|
if cover_tuple.has_cover:
|
||||||
# cdata contains either the resized thumbnail, the full cover.jpg,
|
# cdata contains either the resized thumbnail, the full cover.jpg,
|
||||||
# or None if cover.jpg isn't valid
|
# or None if cover.jpg isn't valid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user