Fix #2044408 [Fallo al convertir a LRF desde docx en version 7](https://bugs.launchpad.net/calibre/+bug/2044408)

This commit is contained in:
Kovid Goyal 2023-11-24 08:04:20 +05:30
parent 320fb96bbd
commit ed00de3b23
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 3 deletions

View File

@ -1809,7 +1809,7 @@ def process_file(path, options, logger):
cim.convert('RGB').save(cf.name)
options.cover = cf.name
tim = im.resize((int(0.75*th), th), PILImage.ANTIALIAS).convert('RGB')
tim = im.resize((int(0.75*th), th), PILImage.Resampling.LANCZOS).convert('RGB')
tf = PersistentTemporaryFile(prefix=__appname__+'_', suffix=".jpg")
tf.close()
tim.save(tf.name)

View File

@ -145,7 +145,8 @@ class Cell:
continue
word = token.split()
word = word[0] if word else ""
width = font.getsize(word)[0]
fl, ft, fr, fb = font.getbbox(word)
width = fr - fl
if width > mwidth:
mwidth = width
return parindent + mwidth + 2
@ -191,7 +192,8 @@ class Cell:
if (ff, fs) != (ts['fontfacename'], ts['fontsize']):
font = get_font(ff, self.pts_to_pixels(fs))
for word in token.split():
width, height = font.getsize(word)
fl, ft, fr, fb = font.getbbox(word)
width, height = fr - fl, abs(fb - ft)
left, right, top, bottom = add_word(width, height, left, right, top, bottom, ls, ws)
return right+3+max(parindent, 10), bottom