Processing of images should call process_alignment

This commit is contained in:
Kovid Goyal 2007-05-15 14:00:59 +00:00
parent 61c7035c3f
commit 32088f598b

View File

@ -392,7 +392,11 @@ class HTMLConverter(object):
temp = {}
for key in pcss.keys():
chk = key.lower()
if chk.startswith('font') or chk == 'text-align':
# float should not be inherited according to the CSS spec
# however we need to as we don't do alignment at a block level.
# float is removed by the process_alignment function.
if chk.startswith('font') or chk == 'text-align' or \
chk == 'float':
temp[key] = pcss[key]
prop.update(temp)
@ -636,6 +640,13 @@ class HTMLConverter(object):
align = "foot"
elif val == "center":
align = "center"
if css.has_key('float'):
val = css['float'].lower()
if val == 'left':
align = 'head'
if val == 'right':
align = 'foot'
css.pop('float')
if align != self.current_block.textStyle.attrs['align']:
self.current_para.append_to(self.current_block)
self.current_block.append_to(self.current_page)
@ -824,6 +835,9 @@ class HTMLConverter(object):
if not self.images.has_key(path):
self.images[path] = ImageStream(path)
factor = 720./self.profile.dpi
self.process_alignment(tag_css)
if max(width, height) <= min(self.profile.page_width,
self.profile.page_height)/5.:
im = Image(self.images[path], x0=0, y0=0, x1=width, y1=height,\