This commit is contained in:
Kovid Goyal 2014-02-13 10:09:38 +05:30
parent 3f8460c2d4
commit c1f58cf249

View File

@ -38,6 +38,7 @@ class EPUBHelpBuilder(EpubBuilder):
root = container.parsed(name)
# ADE blows up floating images if their sizes are not specified
for img in root.xpath('//*[local-name() = "img" and (@class = "float-right-img" or @class = "float-left-img")]'):
if 'style' not in img.attrib:
imgname = container.href_to_name(img.get('src'), name)
width, height, fmt = identify_data(container.raw_data(imgname))
img.set('style', 'width: %dpx; height: %dpx' % (width, height))