summaryrefslogtreecommitdiffstats
path: root/src/uri-references.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-03-03 19:27:36 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-03-03 19:27:36 +0000
commit6883bc38b168556ab914bb755e2af6cf57f925d4 (patch)
treea1059582d7b5eb7abd067dcb685ff939dee1c5e5 /src/uri-references.cpp
parentupdate to trunk (diff)
parentFix for W3C test suite filters-displace-01-f.svg. Don't set default colorspac... (diff)
downloadinkscape-6883bc38b168556ab914bb755e2af6cf57f925d4.tar.gz
inkscape-6883bc38b168556ab914bb755e2af6cf57f925d4.zip
update to trunk
(bzr r11950.1.269)
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 ) {