This commit is contained in:
Kovid Goyal 2007-05-14 17:57:09 +00:00
parent a4acd60399
commit dba36da690
3 changed files with 8 additions and 5 deletions

View File

@ -797,8 +797,8 @@ class HTMLConverter(object):
pass
def scale_image(width, height):
pt = PersistentTemporaryFile(suffix='.png')
im.resize((int(width), int(height)), PILImage.ANTIALIAS).save(pt, 'PNG')
pt = PersistentTemporaryFile(suffix='.jpeg')
im.resize((int(width), int(height)), PILImage.ANTIALIAS).save(pt, 'JPEG')
pt.close()
self.scaled_images[path] = pt
return pt.name
@ -1120,8 +1120,7 @@ def parse_options(argv=None, cli=True):
if cli:
parser.print_help()
raise ConversionError, 'no filename specified'
if options.title == None:
options.title = filename_to_utf8(os.path.splitext(os.path.basename(args[0]))[0])
return options, args, parser

View File

@ -258,6 +258,9 @@ class LrsContainer(object):
for child in self.contents:
if child.has_text():
return True
for item in self.contents:
if isinstance(item, Plot):
return True
return False
def append_to(self, parent):
@ -267,6 +270,7 @@ class LrsContainer(object):
'''
if self.has_text():
parent.append(self)
def appendReferencedObjects(self, parent):
for c in self.contents:

View File

@ -91,7 +91,7 @@ def convert_txt(path, options):
block.Paragraph(buffer)
buffer = ''
basename = os.path.basename(path)
oname = options.output
oname = options.output
if not oname:
oname = os.path.splitext(basename)[0]+('.lrs' if options.lrs else '.lrf')
oname = os.path.abspath(os.path.expanduser(oname))