From: buliabyak Date: Fri, 20 Jun 2008 16:38:39 +0000 (+0000) Subject: patch from 226459, approved by joel X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=faa082b064600b0b97105a8814e831ce6177a6a1;p=inkscape.git patch from 226459, approved by joel --- diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index d26762bd3..f9eab673a 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -938,18 +938,26 @@ bool FileOpenDialogImplWin32::set_image_preview() { const Glib::ustring path = utf16_to_ustring(_path_string, _MAX_PATH); + bool successful = false; + _mutex->lock(); - _preview_bitmap_image = Gdk::Pixbuf::create_from_file(path); - if(!_preview_bitmap_image) return false; - _preview_image_width = _preview_bitmap_image->get_width(); - _preview_document_width = _preview_image_width; - _preview_image_height = _preview_bitmap_image->get_height(); - _preview_document_height = _preview_image_height; + try { + _preview_bitmap_image = Gdk::Pixbuf::create_from_file(path); + if (_preview_bitmap_image) { + _preview_image_width = _preview_bitmap_image->get_width(); + _preview_document_width = _preview_image_width; + _preview_image_height = _preview_bitmap_image->get_height(); + _preview_document_height = _preview_image_height; + successful = true; + } + } + catch (const Gdk::PixbufError&) {} + catch (const Glib::FileError&) {} _mutex->unlock(); - return true; + return successful; } void FileOpenDialogImplWin32::render_preview()