diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-01-18 04:51:59 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-01-18 04:51:59 +0000 |
| commit | 8ce1d4c9f4cad86fb0b1f63c6b25838c8c6d640d (patch) | |
| tree | a47a49ef4679268ad1548c4de005e381997c3c65 /src/sp-image.cpp | |
| parent | libUEMF update; EMF linear gradient bug fixes (bug #1263242) (diff) | |
| download | inkscape-8ce1d4c9f4cad86fb0b1f63c6b25838c8c6d640d.tar.gz inkscape-8ce1d4c9f4cad86fb0b1f63c6b25838c8c6d640d.zip | |
Fix missing embeded image condition, kindly caught by suv in bug #1270334
Fixed bugs:
- https://launchpad.net/bugs/1270334
(bzr r12954)
Diffstat (limited to 'src/sp-image.cpp')
| -rw-r--r-- | src/sp-image.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sp-image.cpp b/src/sp-image.cpp index f4995ce31..b08d6f9b0 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -340,13 +340,18 @@ void SPImage::update(SPCtx *ctx, unsigned int flags) { this->getRepr()->attribute("sodipodi:absref"), doc->getBase()); - if(filename && g_str_has_suffix(filename, ".svg")) { + Inkscape::Pixbuf::create_from_data_uri(filename); + if (strncmp (filename,"data:", 5) == 0) { + filename += 5; + pixbuf = Inkscape::Pixbuf::create_from_data_uri(filename); + } else if(filename && g_str_has_suffix(filename, ".svg")) { // TODO: We want to deal with svg images properly. This // space allows us to do so later. g_warning("Including svg images tags is not yet supported."); } else if (filename) { pixbuf = Inkscape::Pixbuf::create_from_file(filename); - } else { + } + if(!pixbuf) { /* Nope: We do not find any valid pixmap file :-( */ pixbuf = new Inkscape::Pixbuf( gdk_pixbuf_new_from_xpm_data((const gchar **) brokenimage_xpm)); @@ -671,7 +676,7 @@ gchar const *sp_image_repr_read_filename(gchar const *href, gchar const *absref, filename = g_filename_from_uri(filename, NULL, NULL); } else if (strncmp (filename,"data:",5) == 0) { /* data URI - embedded image */ - filename += 5; + return filename; } else if (!g_path_is_absolute (filename)) { /* try to load from relative pos combined with document base*/ const gchar *docbase = base; |
