]> www.fi.muni.cz Git - evince.git/commitdiff
Save images as png or jpg when the filename has no extensions
authorPatrick Ammann <pammann@gmx.net>
Mon, 14 Sep 2009 12:54:04 +0000 (14:54 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 14 Sep 2009 12:54:04 +0000 (14:54 +0200)
shell/ev-window.c

index 89d325d33049cb3d64a7f7401bfa5bc7847bd5bb..027ddb8d4f5358d2a09d6a36e9bf039179cc3a3f 100644 (file)
@@ -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",