mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #113 again
This commit is contained in:
parent
0199499284
commit
a569112e43
@ -1143,7 +1143,7 @@ def process_file(path, options):
|
|||||||
im = PILImage.open(os.path.join(cwd, cpath))
|
im = PILImage.open(os.path.join(cwd, cpath))
|
||||||
cim = im.resize((options.profile.screen_width,
|
cim = im.resize((options.profile.screen_width,
|
||||||
options.profile.screen_height),
|
options.profile.screen_height),
|
||||||
PILImage.BICUBIC)
|
PILImage.BICUBIC).convert('RGB')
|
||||||
cf = PersistentTemporaryFile(prefix="html2lrf_", suffix=".jpg")
|
cf = PersistentTemporaryFile(prefix="html2lrf_", suffix=".jpg")
|
||||||
cf.close()
|
cf.close()
|
||||||
cim.save(cf.name)
|
cim.save(cf.name)
|
||||||
|
@ -61,8 +61,16 @@ def main():
|
|||||||
if not l:
|
if not l:
|
||||||
l = glob.glob(os.path.join(tdir, '*top*.htm*'))
|
l = glob.glob(os.path.join(tdir, '*top*.htm*'))
|
||||||
if not l:
|
if not l:
|
||||||
raise ConversionError, 'Conversion of lit to html failed.'
|
l = glob.glob(os.path.join(tdir, '*.htm*'))
|
||||||
htmlfile = l[0]
|
if not l:
|
||||||
|
raise ConversionError, 'Conversion of lit to html failed. Cannot find html file.'
|
||||||
|
maxsize, htmlfile = 0, None
|
||||||
|
for c in l:
|
||||||
|
sz = os.path.getsize(c)
|
||||||
|
if sz > maxsize:
|
||||||
|
maxsize, htmlfile = sz, c
|
||||||
|
else:
|
||||||
|
htmlfile = l[0]
|
||||||
for i in range(1, len(sys.argv)):
|
for i in range(1, len(sys.argv)):
|
||||||
if sys.argv[i] == args[0]:
|
if sys.argv[i] == args[0]:
|
||||||
sys.argv.remove(sys.argv[i])
|
sys.argv.remove(sys.argv[i])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user