mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix conversion to JPEG
This commit is contained in:
parent
5961fe6fc7
commit
98f18fb074
@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
|
||||
suit your distribution.
|
||||
"""
|
||||
|
||||
__version__ = "0.3.29"
|
||||
__version__ = "0.3.30"
|
||||
__docformat__ = "epytext"
|
||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
|
@ -631,7 +631,7 @@ class HTMLConverter(object):
|
||||
'''
|
||||
align = 'head'
|
||||
if css.has_key('text-align'):
|
||||
val = css['text-align']
|
||||
val = css['text-align'].lower()
|
||||
if val in ["right", "foot"]:
|
||||
align = "foot"
|
||||
elif val == "center":
|
||||
@ -799,7 +799,7 @@ class HTMLConverter(object):
|
||||
|
||||
def scale_image(width, height):
|
||||
pt = PersistentTemporaryFile(suffix='.jpeg')
|
||||
im.resize((int(width), int(height)), PILImage.ANTIALIAS).save(pt, 'JPEG')
|
||||
im.resize((int(width), int(height)), PILImage.ANTIALIAS).convert('RGB').save(pt, 'JPEG')
|
||||
pt.close()
|
||||
self.scaled_images[path] = pt
|
||||
return pt.name
|
||||
@ -1008,7 +1008,7 @@ def process_file(path, options):
|
||||
matches = glob.glob(re.sub('-', '', item[1])+'.*')
|
||||
for match in matches:
|
||||
if match.lower().endswith('.jpeg') or match.lower().endswith('.jpg') or \
|
||||
match.lower().endswith('.gif') or match.lower().endswith('.bmp'):
|
||||
match.lower().endswith('.gif') or match.lower().endswith('.png'):
|
||||
options.cover = match
|
||||
break
|
||||
if options.cover:
|
||||
|
Loading…
x
Reference in New Issue
Block a user