From 79043077cf4d2d80e3a5fe24282485d7c7e45167 Mon Sep 17 00:00:00 2001 From: JazzyNico Date: Fri, 12 Jun 2009 12:45:35 +0000 Subject: [PATCH] embedimage.py patch for Bug #386069 --- share/extensions/embedimage.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/share/extensions/embedimage.py b/share/extensions/embedimage.py index 93472b325..a6cef5363 100644 --- a/share/extensions/embedimage.py +++ b/share/extensions/embedimage.py @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' -import inkex, os, base64 +import inkex, os, base64, urlparse import gettext _ = gettext.gettext @@ -55,17 +55,15 @@ class Embedder(inkex.Effect): xlink = node.get(inkex.addNS('href','xlink')) if xlink is None or xlink[:5] != 'data:': absref=node.get(inkex.addNS('absref','sodipodi')) - href=xlink + url=urlparse.urlparse(xlink) + href=url.path path='' #path selection strategy: # 1. href if absolute # 2. realpath-ified href # 3. absref, only if the above does not point to a file if (href != None): - if (os.path.isabs(href)): - path=os.path.realpath(href) - else: - path=os.path.realpath(href) + path=os.path.realpath(href) if (not os.path.isfile(path)): if (absref != None): path=absref -- 2.30.2