mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2044408 [Fallo al convertir a LRF desde docx en version 7](https://bugs.launchpad.net/calibre/+bug/2044408)
This commit is contained in:
parent
320fb96bbd
commit
ed00de3b23
@ -1809,7 +1809,7 @@ def process_file(path, options, logger):
|
|||||||
cim.convert('RGB').save(cf.name)
|
cim.convert('RGB').save(cf.name)
|
||||||
options.cover = 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 = PersistentTemporaryFile(prefix=__appname__+'_', suffix=".jpg")
|
||||||
tf.close()
|
tf.close()
|
||||||
tim.save(tf.name)
|
tim.save(tf.name)
|
||||||
|
@ -145,7 +145,8 @@ class Cell:
|
|||||||
continue
|
continue
|
||||||
word = token.split()
|
word = token.split()
|
||||||
word = word[0] if word else ""
|
word = word[0] if word else ""
|
||||||
width = font.getsize(word)[0]
|
fl, ft, fr, fb = font.getbbox(word)
|
||||||
|
width = fr - fl
|
||||||
if width > mwidth:
|
if width > mwidth:
|
||||||
mwidth = width
|
mwidth = width
|
||||||
return parindent + mwidth + 2
|
return parindent + mwidth + 2
|
||||||
@ -191,7 +192,8 @@ class Cell:
|
|||||||
if (ff, fs) != (ts['fontfacename'], ts['fontsize']):
|
if (ff, fs) != (ts['fontfacename'], ts['fontsize']):
|
||||||
font = get_font(ff, self.pts_to_pixels(fs))
|
font = get_font(ff, self.pts_to_pixels(fs))
|
||||||
for word in token.split():
|
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)
|
left, right, top, bottom = add_word(width, height, left, right, top, bottom, ls, ws)
|
||||||
return right+3+max(parindent, 10), bottom
|
return right+3+max(parindent, 10), bottom
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user