mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3257 (embedded graphics in .odt file look bad when converted to .epub format)
This commit is contained in:
parent
958bdb549e
commit
06c77e05a1
@ -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')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user