mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:13:50 +02:00
MOBI Output: Handle invalid height and width settings on <img> tags
This commit is contained in:
parent
b0ad8e00e4
commit
63a10e7753
1 changed files with 4 additions and 1 deletions
|
|
@ -356,7 +356,10 @@ def mobimlize_elem(self, elem, stylizer, bstate, istates):
|
|||
if value == getattr(self.profile, prop):
|
||||
result = '100%'
|
||||
else:
|
||||
ems = int(round(value / self.profile.fbase))
|
||||
try:
|
||||
ems = int(round(float(value) / self.profile.fbase))
|
||||
except:
|
||||
continue
|
||||
result = "%dem" % ems
|
||||
istate.attrib[prop] = result
|
||||
elif tag == 'hr' and asfloat(style['width']) > 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue