aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor/e-contact-editor.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-02-09 16:26:20 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-02-09 16:26:20 +0800
commitdb89b2ded3ec3a81078718cbffe2aada8290067b (patch)
tree58560d4d01c00026c7bd0ed3a1c4961d9561c64f /addressbook/gui/contact-editor/e-contact-editor.c
parentb1e5618d623c9e73c25580ed9c0e5168a0390d0f (diff)
downloadgsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar.gz
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar.bz2
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar.lz
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar.xz
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.tar.zst
gsoc2013-evolution-db89b2ded3ec3a81078718cbffe2aada8290067b.zip
** Fix for bug #332908
svn path=/trunk/; revision=33188
Diffstat (limited to 'addressbook/gui/contact-editor/e-contact-editor.c')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c42
1 files changed, 23 insertions, 19 deletions
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);
}