summaryrefslogtreecommitdiff
path: root/bin/report/render/html2html/html2html.py
diff options
context:
space:
mode:
authordsh (Open ERP) <dsh@tinyerp.com>2009-05-22 11:34:27 +0530
committerdsh (Open ERP) <dsh@tinyerp.com>2009-05-22 11:34:27 +0530
commit1340218b68e69579a6bd5a8db70f0e1a125b0fab (patch)
treee4abc5832ea0c8baec6a5b0424af0fdcdcdde983 /bin/report/render/html2html/html2html.py
parent542f9f3a943ec0c27001ad8068305e9e80b424d5 (diff)
small change
bzr revid: dsh@tinyerp.com-20090522060427-so6i5s127430oq1j
Diffstat (limited to 'bin/report/render/html2html/html2html.py')
-rw-r--r--bin/report/render/html2html/html2html.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py
index 28c22f4b10e..0fd5a687386 100644
--- a/bin/report/render/html2html/html2html.py
+++ b/bin/report/render/html2html/html2html.py
@@ -24,6 +24,8 @@ from report.render.rml2pdf import utils
from lxml import etree
import copy
import pooler
+import base64
+from reportlab.lib.utils import ImageReader
class html2html(object):
@@ -49,6 +51,11 @@ class html2html(object):
src = utils._process_text(self, new_child.get('name'))
if src :
new_child.set('src','data:image/gif;base64,%s'%src)
+ output = cStringIO.StringIO(base64.decodestring(src))
+ img = ImageReader(output)
+ (width,height) = img.getSize()
+ new_child.set('width',str(width))
+ new_child.set('height',str(height))
else :
new_child.getparent().remove(new_child)
new_child.text = utils._process_text(self, child.text)