[evince] Save images as png or jpg when the filename has no extensions
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evince] Save images as png or jpg when the filename has no extensions
- Date: Mon, 14 Sep 2009 12:56:17 +0000 (UTC)
commit 4a9b54426b47288064f0852635041a2e349f7aab
Author: Patrick Ammann <pammann gmx net>
Date: Mon Sep 14 14:54:04 2009 +0200
Save images as png or jpg when the filename has no extensions
shell/ev-window.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 89d325d..027ddb8 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -5603,6 +5603,15 @@ image_save_dialog_response_cb (GtkWidget *fc,
format = get_gdk_pixbuf_format_by_extension (uri);
}
+ if (format == NULL && g_strrstr (uri, ".") == NULL) {
+ /* no extension found and no extension provided within uri */
+ format = get_gdk_pixbuf_format_by_extension (".png");
+ if (format == NULL) {
+ /* no .png support, try .jpeg */
+ format = get_gdk_pixbuf_format_by_extension (".jpeg");
+ }
+ }
+
if (format == NULL) {
ev_window_error_message (ev_window, NULL,
"%s",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]