Code

better fix, and prevent any further crashes; now tested on windows too
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 29 Jun 2009 02:00:29 +0000 (02:00 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 29 Jun 2009 02:00:29 +0000 (02:00 +0000)
src/extension/internal/bitmap/imagemagick.cpp

index bfde84e0c4182dda059a564587738b939f1552d7..ab2834141fb35b543234247b74eac67e13ab1cd7 100644 (file)
@@ -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 (...) {}
        }
 }