[fix] improvement in trml2pdf.py for the image

bzr revid: nco@tinyerp.com-20110530090335-7lamm1fbnalkrhlh
This commit is contained in:
Nimesh (Open ERP) 2011-05-30 14:33:35 +05:30
parent b166b367be
commit fe230bbb6d
1 changed files with 5 additions and 5 deletions

View File

@ -447,14 +447,14 @@ class _rml_canvas(object):
self._logger.debug("Image %s used", node.get('name'))
s = StringIO(image_data)
else:
newtext = node.text
if self.localcontext:
res = utils._regex.findall(node.text)
res = utils._regex.findall(newtext)
for key in res:
newtext = eval(key, {}, self.localcontext)
node.text = newtext or ''
newtext = eval(key, {}, self.localcontext) or ''
image_data = None
if node.text:
image_data = base64.decodestring(node.text)
if newtext:
image_data = base64.decodestring(newtext)
if image_data:
s = StringIO(image_data)
else: