From 7e270ac92e016f4e5a95bfce240b01faf1882bef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 24 May 2008 10:07:39 -0700 Subject: [PATCH] Fix regression that made list of books on device un browseable --- src/calibre/gui2/library.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 9d0e392a10..ec87b5371f 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -668,7 +668,11 @@ class DeviceBooksModel(BooksModel): item = self.db[self.map[current.row()]] cdata = item.thumbnail if cdata: - data['cover'] = cdata + img = QImage() + img.loadFromData(cdata) + if img.isNull(): + img = self.default_image + data['cover'] = img type = _('Unknown') ext = os.path.splitext(item.path)[1] if ext: