This commit is contained in:
Kovid Goyal 2007-06-29 02:55:21 +00:00
parent 0199499284
commit a569112e43
2 changed files with 11 additions and 3 deletions

View File

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

View File

@ -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])