mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Mobi doesn't use PNG afterall. Slightly better treatment of 'float's.
This commit is contained in:
parent
d01d57f727
commit
28512fac5a
@ -232,6 +232,7 @@ class MobiMLizer(object):
|
||||
left = 0
|
||||
display = style['display']
|
||||
isblock = not display.startswith('inline')
|
||||
isblock = isblock and style['float'] == 'none'
|
||||
isblock = isblock and tag != 'br'
|
||||
if isblock:
|
||||
bstate.para = None
|
||||
|
@ -311,8 +311,8 @@ class MobiWriter(object):
|
||||
image = Image.open(StringIO(data))
|
||||
format = image.format
|
||||
changed = False
|
||||
if image.format not in ('JPEG', 'GIF', 'PNG'):
|
||||
format = 'PNG'
|
||||
if image.format not in ('JPEG', 'GIF'):
|
||||
format = 'GIF'
|
||||
changed = True
|
||||
if dimen is not None:
|
||||
image.thumbnail(dimen, Image.ANTIALIAS)
|
||||
|
@ -181,7 +181,6 @@ class CSSFlattener(object):
|
||||
left -= style['text-indent']
|
||||
if self.unfloat and 'float' in cssdict \
|
||||
and tag not in ('img', 'object'):
|
||||
del cssdict['float']
|
||||
if cssdict.get('display', 'none') != 'none':
|
||||
del cssdict['display']
|
||||
if 'vertical-align' in cssdict:
|
||||
|
Loading…
x
Reference in New Issue
Block a user