fallback if thumb was not created

This commit is contained in:
Andreas Preikschat 2011-06-06 09:05:10 +02:00
parent e08c65aa45
commit 98e731ee9a

View File

@ -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 '