From 98e731ee9a340040ac6230779ce72d501a19ed34 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 6 Jun 2011 09:05:10 +0200 Subject: [PATCH] fallback if thumb was not created --- openlp/core/lib/mediamanageritem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 954179288..9aa159981 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -407,7 +407,11 @@ class MediaManagerItem(QtGui.QWidget): reader.setScaledSize(QtCore.QSize(int(ratio * 88), 88)) thumb = reader.read() thumb.save(thumb_path, ext[1:]) - return build_icon(unicode(thumb_path)) + if os.path.exists(thumb_path): + return build_icon(unicode(thumb_path)) + # When the thumbnail creation was not successful then create the icon + # from the original file. + return build_icon(unicode(image_path)) def loadList(self, list): raise NotImplementedError(u'MediaManagerItem.loadList needs to be '