Mobi doesn't use PNG afterall. Slightly better treatment of 'float's.

This commit is contained in:
Marshall T. Vandegrift 2009-01-05 08:03:03 -05:00
parent d01d57f727
commit 28512fac5a
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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: