From 1340218b68e69579a6bd5a8db70f0e1a125b0fab Mon Sep 17 00:00:00 2001 From: "dsh (Open ERP)" Date: Fri, 22 May 2009 11:34:27 +0530 Subject: small change bzr revid: dsh@tinyerp.com-20090522060427-so6i5s127430oq1j --- bin/report/render/html2html/html2html.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/report/render/html2html/html2html.py') 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) -- cgit v1.2.3