From: JazzyNico Date: Mon, 9 Aug 2010 18:07:37 +0000 (+0200) Subject: Extensions. Gimp XCF export now works with units in Height and Width attributes ... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5ccbfb5caf24096be9760113beb43185c34661f2;p=inkscape.git Extensions. Gimp XCF export now works with units in Height and Width attributes (bug #485032). --- 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)