mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: Handle invalid height and width settings on <img> tags
This commit is contained in:
parent
b0ad8e00e4
commit
63a10e7753
@ -356,7 +356,10 @@ class MobiMLizer(object):
|
|||||||
if value == getattr(self.profile, prop):
|
if value == getattr(self.profile, prop):
|
||||||
result = '100%'
|
result = '100%'
|
||||||
else:
|
else:
|
||||||
ems = int(round(value / self.profile.fbase))
|
try:
|
||||||
|
ems = int(round(float(value) / self.profile.fbase))
|
||||||
|
except:
|
||||||
|
continue
|
||||||
result = "%dem" % ems
|
result = "%dem" % ems
|
||||||
istate.attrib[prop] = result
|
istate.attrib[prop] = result
|
||||||
elif tag == 'hr' and asfloat(style['width']) > 0:
|
elif tag == 'hr' and asfloat(style['width']) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user