From: buliabyak Date: Mon, 29 Jun 2009 02:00:29 +0000 (+0000) Subject: better fix, and prevent any further crashes; now tested on windows too X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8a651cb10cfde80eb0b06f2690e291eb12d229e9;p=inkscape.git better fix, and prevent any further crashes; now tested on windows too --- diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index bfde84e0c..ab2834141 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -120,10 +120,14 @@ ImageMagickDocCache::readImage(const char *xlink, Magick::Image *image) image->read(blob); } else { - if (!strncmp(xlink, "file://", 7) && strlen(xlink) > 7) - image->read(xlink + 7); - else - image->read(xlink); + const gchar *path = xlink; + if (strncmp (xlink,"file:", 5) == 0) { + path = g_filename_from_uri(xlink, NULL, NULL); + } + + try { + image->read(path); + } catch (...) {} } }