summaryrefslogtreecommitdiffstats
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
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)
-rwxr-xr-xshare/extensions/test/hpgl_output.test.py4
-rw-r--r--src/display/nr-filter-image.cpp5
-rw-r--r--src/filters/image.cpp2
-rw-r--r--src/uri-references.cpp16
4 files changed, 20 insertions, 7 deletions
diff --git a/share/extensions/test/hpgl_output.test.py b/share/extensions/test/hpgl_output.test.py
index 4d9500b1e..19fdeb661 100755
--- a/share/extensions/test/hpgl_output.test.py
+++ b/share/extensions/test/hpgl_output.test.py
@@ -12,13 +12,13 @@ sys.path.append('..') # this line allows to import the extension code
import unittest
from hpgl_output import *
-class MyEffectBasicTest(unittest.TestCase):
+class HPGLOuputBasicTest(unittest.TestCase):
#def setUp(self):
def test_run_without_parameters(self):
args = [ 'minimal-blank.svg' ]
- e = MyEffect()
+ e = HpglOutput()
e.affect( args, False )
#self.assertEqual( e.something, 'some value', 'A commentary about that.' )
diff --git a/src/display/nr-filter-image.cpp b/src/display/nr-filter-image.cpp
index 154d1ab32..179ba0e0a 100644
--- a/src/display/nr-filter-image.cpp
+++ b/src/display/nr-filter-image.cpp
@@ -114,7 +114,7 @@ void FilterImage::render_cairo(FilterSlot &slot)
// dc.scale(scaleX, scaleY); No scaling should be done
Geom::IntRect render_rect = area.roundOutwards();
- dc.translate(render_rect.min());
+// dc.translate(render_rect.min()); This seems incorrect
// Update to renderable state
drawing.update(render_rect);
@@ -174,7 +174,8 @@ void FilterImage::render_cairo(FilterSlot &slot)
sa.width(), sa.height());
// For the moment, we'll assume that any image is in sRGB color space
- set_cairo_surface_ci(out, SP_CSS_COLOR_INTERPOLATION_SRGB);
+ // set_cairo_surface_ci(out, SP_CSS_COLOR_INTERPOLATION_SRGB);
+ // This seemed like a sensible thing to do but it breaks filters-displace-01-f.svg
cairo_t *ct = cairo_create(out);
cairo_translate(ct, -sa.min()[Geom::X], -sa.min()[Geom::Y]);
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 ) {