From 5ccbfb5caf24096be9760113beb43185c34661f2 Mon Sep 17 00:00:00 2001 From: JazzyNico Date: Mon, 9 Aug 2010 20:07:37 +0200 Subject: [PATCH] Extensions. Gimp XCF export now works with units in Height and Width attributes (bug #485032). --- share/extensions/gimp_xcf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 92da6cf40..b849d948a 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -41,8 +41,8 @@ class MyEffect(inkex.Effect): def effect(self): svg_file = self.args[-1] docname = self.xpathSingle('/svg:svg/@sodipodi:docname')[:-4] - pageHeight = int(self.xpathSingle('/svg:svg/@height').split('.')[0]) - pageWidth = int(self.xpathSingle('/svg:svg/@width').split('.')[0]) + pageHeight = int(inkex.unittouu(self.xpathSingle('/svg:svg/@height').split('.')[0])) + pageWidth = int(inkex.unittouu(self.xpathSingle('/svg:svg/@width').split('.')[0])) #create os temp dir tmp_dir = tempfile.mkdtemp() @@ -98,8 +98,7 @@ class MyEffect(inkex.Effect): path = "/svg:svg/*[name()='g' or @style][@id]" for node in self.document.xpath(path, namespaces=inkex.NSS): id = node.get('id') - name = "%s.png" % id - filename = os.path.join(tmp_dir, name) + filename = os.path.join(tmp_dir, "%s.png" % id) command = "inkscape -i %s -j %s -e %s %s " % (id, area, filename, svg_file) if bsubprocess: p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) -- 2.30.2