newdb: Fix passing in QImage to set_cover not working

This commit is contained in:
Kovid Goyal 2013-09-16 14:10:54 +05:30
parent 6a893e48d8
commit 3046339a18

View File

@ -1273,8 +1273,7 @@ class DB(object):
if callable(getattr(data, 'save', None)): if callable(getattr(data, 'save', None)):
from calibre.gui2 import pixmap_to_data from calibre.gui2 import pixmap_to_data
data = pixmap_to_data(data) data = pixmap_to_data(data)
else: elif callable(getattr(data, 'read', None)):
if callable(getattr(data, 'read', None)):
data = data.read() data = data.read()
if data is None: if data is None:
if os.path.exists(path): if os.path.exists(path):