diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-03-03 10:31:09 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-03-03 10:31:09 +0000 |
| commit | bcb34494fe93d057210bc7e4048da66ce455c953 (patch) | |
| tree | 62d5617972162e102499e0b2ca4c99c67233ee9a /src | |
| parent | Test. Fix for Bug #1286977 (trunk: make check fails (hpgl_output)). (diff) | |
| download | inkscape-bcb34494fe93d057210bc7e4048da66ce455c953.tar.gz inkscape-bcb34494fe93d057210bc7e4048da66ce455c953.zip | |
Don't try to load JPG and PNG files with createChildDoc().
(bzr r13099)
Diffstat (limited to 'src')
| -rw-r--r-- | src/filters/image.cpp | 2 | ||||
| -rw-r--r-- | src/uri-references.cpp | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/filters/image.cpp b/src/filters/image.cpp index 9a1b85911..6e50a0e3c 100644 --- a/src/filters/image.cpp +++ b/src/filters/image.cpp @@ -134,7 +134,7 @@ void SPFeImage::set(unsigned int key, gchar const *value) { this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; } else { - g_warning("SVG element URI was not found in the document while loading this"); + g_warning("SVG element URI was not found in the document while loading this: %s", value); } } // catches either MalformedURIException or UnsupportedURIException 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 ) { |
