mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
DOCX Input: When converting images placed using the obsolete VML markup default them to being inline rather than block images. Fixes #1905319 [Centered images aren't centered after conversion](https://bugs.launchpad.net/calibre/+bug/1905319)
Also seems to match Word behavior.
This commit is contained in:
parent
3dbbe1397e
commit
b6b1af097b
@ -306,9 +306,12 @@ class Images(object):
|
||||
except LinkedImageNotFound as err:
|
||||
self.log.warn('Linked image: %s not found, ignoring' % err.fname)
|
||||
continue
|
||||
img = IMG(src='images/%s' % src, style="display:block")
|
||||
style = get(imagedata.getparent(), 'style')
|
||||
img = IMG(src='images/%s' % src)
|
||||
alt = get(imagedata, 'o:title')
|
||||
img.set('alt', alt or 'Image')
|
||||
if 'position:absolute' in style:
|
||||
img.set('style', 'display: block')
|
||||
yield img
|
||||
|
||||
def get_float_properties(self, anchor, style, page):
|
||||
|
Loading…
x
Reference in New Issue
Block a user