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

View File

@ -38,9 +38,10 @@ class EPUBHelpBuilder(EpubBuilder):
root = container.parsed(name) root = container.parsed(name)
# ADE blows up floating images if their sizes are not specified # 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")]'): for img in root.xpath('//*[local-name() = "img" and (@class = "float-right-img" or @class = "float-left-img")]'):
imgname = container.href_to_name(img.get('src'), name) if 'style' not in img.attrib:
width, height, fmt = identify_data(container.raw_data(imgname)) imgname = container.href_to_name(img.get('src'), name)
img.set('style', 'width: %dpx; height: %dpx' % (width, height)) width, height, fmt = identify_data(container.raw_data(imgname))
img.set('style', 'width: %dpx; height: %dpx' % (width, height))
def fix_opf(self, container): def fix_opf(self, container):
spine_names = {n for n, l in container.spine_names} spine_names = {n for n, l in container.spine_names}