From 8a651cb10cfde80eb0b06f2690e291eb12d229e9 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 29 Jun 2009 02:00:29 +0000 Subject: [PATCH] better fix, and prevent any further crashes; now tested on windows too --- src/extension/internal/bitmap/imagemagick.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 (...) {} } } -- 2.30.2