From db89b2ded3ec3a81078718cbffe2aada8290067b Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 9 Feb 2007 08:26:20 +0000 Subject: ** Fix for bug #332908 svn path=/trunk/; revision=33188 --- addressbook/gui/contact-editor/e-contact-editor.c | 42 +++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'addressbook/gui/contact-editor/e-contact-editor.c') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 5f8d348bb9..9926bfc40c 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2280,27 +2280,31 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) height = gdk_pixbuf_get_height (pixbuf); width = gdk_pixbuf_get_width (pixbuf); - prompt_response = e_error_run (GTK_WINDOW (editor->app), "addressbook:prompt-resize", NULL); - if ((height > 96 || width > 96) && prompt_response == GTK_RESPONSE_YES){ - if ( width > height) { - height = height * 96 / width; - width = 96; - } else { - width = width *96 / height; - height = 96; - } + if ((height > 96 || width > 96)) { + + prompt_response = e_error_run (GTK_WINDOW (editor->app), "addressbook:prompt-resize", NULL); + + if (prompt_response == GTK_RESPONSE_YES){ + if ( width > height) { + height = height * 96 / width; + width = 96; + } else { + width = width *96 / height; + height = 96; + } - new = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR); - if (new) { - g_free(photo.data.inlined.data); - gdk_pixbuf_save_to_buffer (new, (gchar **)&photo.data.inlined.data, &photo.data.inlined.length, "jpeg", NULL, "quality", "100", NULL); - g_object_unref (new); + new = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR); + if (new) { + g_free(photo.data.inlined.data); + gdk_pixbuf_save_to_buffer (new, (gchar **)&photo.data.inlined.data, &photo.data.inlined.length, "jpeg", NULL, "quality", "100", NULL); + g_object_unref (new); + } + } + else if (prompt_response == GTK_RESPONSE_CANCEL) { + g_object_unref (pixbuf); + g_object_unref (loader); + return; } - } - else if (prompt_response == GTK_RESPONSE_CANCEL) { - g_object_unref (pixbuf); - g_object_unref (loader); - return; } g_object_unref (pixbuf); } -- cgit v1.2.3