summaryrefslogtreecommitdiffstats
path: root/src/uri-references.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-03-03 10:31:09 +0000
committertavmjong-free <tavmjong@free.fr>2014-03-03 10:31:09 +0000
commitbcb34494fe93d057210bc7e4048da66ce455c953 (patch)
tree62d5617972162e102499e0b2ca4c99c67233ee9a /src/uri-references.cpp
parentTest. Fix for Bug #1286977 (trunk: make check fails (hpgl_output)). (diff)
downloadinkscape-bcb34494fe93d057210bc7e4048da66ce455c953.tar.gz
inkscape-bcb34494fe93d057210bc7e4048da66ce455c953.zip
Don't try to load JPG and PNG files with createChildDoc().
(bzr r13099)
Diffstat (limited to 'src/uri-references.cpp')
-rw-r--r--src/uri-references.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp
index ea8078b28..5cdf132fa 100644
--- a/src/uri-references.cpp
+++ b/src/uri-references.cpp
@@ -56,8 +56,19 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
document = _owner_document;
}
+ // createChildDoc() assumes that the referenced file is an SVG.
+ // PNG and JPG files are allowed (in the case of feImage).
+ gchar *filename = uri.toString();
+ bool skip = false;
+ if( g_str_has_suffix( filename, ".jpg" ) ||
+ g_str_has_suffix( filename, ".JPG" ) ||
+ g_str_has_suffix( filename, ".png" ) ||
+ g_str_has_suffix( filename, ".PNG" ) ) {
+ skip = true;
+ }
+
// The path contains references to seperate document files to load.
- if(document && uri.getPath()) {
+ if(document && uri.getPath() && !skip ) {
std::string base = document->getBase() ? document->getBase() : "";
std::string path = uri.getFullPath(base);
if(!path.empty())
@@ -66,9 +77,10 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
document = NULL;
}
if(!document) {
- g_warning("Can't get document for referenced URI: %s", uri.toString());
+ g_warning("Can't get document for referenced URI: %s", filename);
return;
}
+ g_free( filename );
gchar const *fragment = uri.getFragment();
if ( !uri.isRelative() || uri.getQuery() || !fragment ) {