mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #67
This commit is contained in:
parent
a4acd60399
commit
dba36da690
@ -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
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user