From f93a8ec1f26ca809f77308c8c057ee6417b8a245 Mon Sep 17 00:00:00 2001 From: theadib Date: Tue, 5 May 2009 23:19:43 +0000 Subject: [PATCH] using uri syntax while importing files using xlink:href --- src/extension/internal/gdkpixbuf-input.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 773913ffc..0acf1648c 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -55,7 +55,14 @@ GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) // import as repr = xml_doc->createElement("svg:image"); - repr->setAttribute("xlink:href", uri); + // convert filename to uri + gchar* _uri = g_filename_to_uri(uri, NULL, NULL); + if(_uri) { + repr->setAttribute("xlink:href", _uri); + g_free(_uri); + } else { + repr->setAttribute("xlink:href", uri); + } /* impl: doc->base is currently NULL, so we can use uri for href whether it's absolute * or relative. The href will get rewritten by rebase_hrefs if by chance uri is relative * and doc gets saved to a different directory. -- 2.30.2