From 3c4f91204b703e14a6e1f8fe18a96a9ec9ec5d25 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 Jul 2010 14:53:23 -0600 Subject: [PATCH] SONY driver: Don't abort in presence of corrupted thumbnails --- src/calibre/devices/prs505/sony_cache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index 3ac35df9b2..46ccf1f3d2 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -328,7 +328,10 @@ class XMLCache(object): 'descendant::*[local-name()="jpeg"]|' 'descendant::*[local-name()="png"]'): if img.text: - raw = b64decode(img.text.strip()) + try: + raw = b64decode(img.text.strip()) + except: + continue book.thumbnail = raw break break