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
|
left = 0
|
||||||
display = style['display']
|
display = style['display']
|
||||||
isblock = not display.startswith('inline')
|
isblock = not display.startswith('inline')
|
||||||
|
isblock = isblock and style['float'] == 'none'
|
||||||
isblock = isblock and tag != 'br'
|
isblock = isblock and tag != 'br'
|
||||||
if isblock:
|
if isblock:
|
||||||
bstate.para = None
|
bstate.para = None
|
||||||
|
@ -311,8 +311,8 @@ class MobiWriter(object):
|
|||||||
image = Image.open(StringIO(data))
|
image = Image.open(StringIO(data))
|
||||||
format = image.format
|
format = image.format
|
||||||
changed = False
|
changed = False
|
||||||
if image.format not in ('JPEG', 'GIF', 'PNG'):
|
if image.format not in ('JPEG', 'GIF'):
|
||||||
format = 'PNG'
|
format = 'GIF'
|
||||||
changed = True
|
changed = True
|
||||||
if dimen is not None:
|
if dimen is not None:
|
||||||
image.thumbnail(dimen, Image.ANTIALIAS)
|
image.thumbnail(dimen, Image.ANTIALIAS)
|
||||||
|
@ -181,7 +181,6 @@ class CSSFlattener(object):
|
|||||||
left -= style['text-indent']
|
left -= style['text-indent']
|
||||||
if self.unfloat and 'float' in cssdict \
|
if self.unfloat and 'float' in cssdict \
|
||||||
and tag not in ('img', 'object'):
|
and tag not in ('img', 'object'):
|
||||||
del cssdict['float']
|
|
||||||
if cssdict.get('display', 'none') != 'none':
|
if cssdict.get('display', 'none') != 'none':
|
||||||
del cssdict['display']
|
del cssdict['display']
|
||||||
if 'vertical-align' in cssdict:
|
if 'vertical-align' in cssdict:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user