Fix #3257 (embedded graphics in .odt file look bad when converted to .epub format)

This commit is contained in:
Kovid Goyal 2009-09-17 10:00:32 -06:00
parent 958bdb549e
commit 06c77e05a1

View File

@ -34,6 +34,11 @@ class Extract(ODF2XHTML):
with CurrentDir(odir): with CurrentDir(odir):
print 'Extracting ODT file...' print 'Extracting ODT file...'
html = self.odf2xhtml(stream) html = self.odf2xhtml(stream)
# A blanket img specification like this causes problems
# with EPUB output as the contaiing element often has
# an absolute height and width set that is larger than
# the available screen real estate
html = html.replace('img { width: 100%; height: 100%; }', '')
with open('index.xhtml', 'wb') as f: with open('index.xhtml', 'wb') as f:
f.write(html.encode('utf-8')) f.write(html.encode('utf-8'))
zf = ZipFile(stream, 'r') zf = ZipFile(stream, 'r')