Pickup cover from archives if filename is specified

This commit is contained in:
Kovid Goyal 2007-08-12 22:22:38 +00:00
parent 0b68623f86
commit 97eab19417

View File

@ -1284,8 +1284,10 @@ def process_file(path, options, logger=None):
cpath, tpath = '', '' cpath, tpath = '', ''
try_opf(path, options, logger) try_opf(path, options, logger)
if options.cover: if options.cover:
options.cover = os.path.abspath(os.path.expanduser(options.cover)) cpath = os.path.join(dirpath, os.path.basename(options.cover))
cpath = options.cover if not os.path.exists(cpath):
cpath = os.path.abspath(os.path.expanduser(options.cover))
options.cover = cpath
if os.access(options.cover, os.R_OK): if os.access(options.cover, os.R_OK):
from libprs500.devices.prs500.driver import PRS500 from libprs500.devices.prs500.driver import PRS500
im = PILImage.open(os.path.join(cwd, cpath)) im = PILImage.open(os.path.join(cwd, cpath))