Index: addressbook/gui/contact-editor/e-contact-editor.c
===================================================================
--- addressbook/gui/contact-editor/e-contact-editor.c	(revision 34396)
+++ addressbook/gui/contact-editor/e-contact-editor.c	(working copy)
@@ -2293,7 +2293,7 @@
 								height = 96;
 							}
 						
-							new = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
+							new = e_icon_factory_pixbuf_scale (pixbuf, width, height);
 							if (new) {
 								GdkPixbufFormat *format = gdk_pixbuf_loader_get_format (loader);
 								gchar *format_name = gdk_pixbuf_format_get_name (format);
Index: addressbook/ChangeLog
===================================================================
--- addressbook/ChangeLog	(revision 34396)
+++ addressbook/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #488213
+
+	* gui/contact-editor/e-contact-editor.c: (extract_simple_field):
+	Use global function e_icon_factory_pixbuf_scale for scaling pixbufs.
+
 2007-10-18  Tobias Mueller  <tobiasmue@svn.gnome.org>
 	Patch by Michael Monreal <michael.monreal@gmx.net>
 	
Index: mail/em-icon-stream.c
===================================================================
--- mail/em-icon-stream.c	(revision 34396)
+++ mail/em-icon-stream.c	(working copy)
@@ -30,11 +30,9 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
-#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
-#include <libgnomeui/gnome-thumbnail.h>
-#endif
 #include <gtk/gtkimage.h>
 #include "em-icon-stream.h"
+#include "e-util/e-icon-factory.h"
 
 #include "libedataserver/e-msgport.h"
 
@@ -187,11 +185,7 @@
 		if (height <= 0)
 			height = 1;
 
-#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
-		mini = gnome_thumbnail_scale_down_pixbuf(pixbuf, width, height);
-#else
-		mini = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR);
-#endif
+		mini = e_icon_factory_pixbuf_scale (pixbuf, width, height);
 	}
 
 	return mini;
Index: mail/ChangeLog
===================================================================
--- mail/ChangeLog	(revision 34396)
+++ mail/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #488213
+
+	* em-icon-stream.c: (emis_fit):
+	* em-format-html-display.c: (efhd_attachment_button):
+	Use global function e_icon_factory_pixbuf_scale for scaling pixbufs.
+
 2007-10-15  Matthew Barnes  <mbarnes@redhat.com>
 
 	* em-folder-view.c:
Index: mail/em-format-html-display.c
===================================================================
--- mail/em-format-html-display.c	(revision 34396)
+++ mail/em-format-html-display.c	(working copy)
@@ -1883,7 +1883,7 @@
 		GdkPixbuf *pixbuf, *mini;
 		
 		if ((pixbuf = e_icon_for_mime_type (simple_type, 24))) {
-			if ((mini = gdk_pixbuf_scale_simple (pixbuf, 24, 24, GDK_INTERP_BILINEAR))) {
+			if ((mini = e_icon_factory_pixbuf_scale (pixbuf, 24, 24))) {
 				gtk_image_set_from_pixbuf ((GtkImage *) w, mini);
 				g_object_unref (mini);
 			}
Index: e-util/ChangeLog
===================================================================
--- e-util/ChangeLog	(revision 34396)
+++ e-util/ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #488213
+
+	* e-icon-factory.h: (e_icon_factory_pixbuf_scale):
+	* e-icon-factory.c: (e_icon_factory_pixbuf_scale):
+	New global function for pixbuf scaling which speeds up scaling when
+	HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H.
+	* e-icon-factory.c: (load_icon):
+	Use global function e_icon_factory_pixbuf_scale for scaling pixbufs.
+
 2007-10-12  Michael Monreal <michael.monreal@gmail.com>
 
 	** Migration of theme icons to data/icons/ (bug #479257)
Index: e-util/e-icon-factory.c
===================================================================
--- e-util/e-icon-factory.c	(revision 34396)
+++ e-util/e-icon-factory.c	(working copy)
@@ -32,6 +32,9 @@
 
 #include <gtk/gtkicontheme.h>
 #include <gtk/gtkimage.h>
+#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
+#include <libgnomeui/gnome-thumbnail.h>
+#endif
 
 #include "e-icon-factory.h"
 #include "e-util-private.h"
@@ -161,7 +164,7 @@
 	if (unscaled != NULL) {
 		if(gdk_pixbuf_get_width(unscaled) != size || gdk_pixbuf_get_height(unscaled) != size)
 		{
-			pixbuf = gdk_pixbuf_scale_simple (unscaled, size, size, GDK_INTERP_BILINEAR);
+			pixbuf = e_icon_factory_pixbuf_scale (unscaled, size, size);
 			g_object_unref (unscaled);
 		} else
 			pixbuf = unscaled;
@@ -402,3 +405,29 @@
 
 	return list;
 }
+
+/**
+ * e_icon_factory_pixbuf_scale
+ * Scales pixbuf to desired size.
+ * @param pixbuf Pixbuf to be scaled.
+ * @param width Desired width, if less or equal to 0, then changed to 1.
+ * @param height Desired height, if less or equal to 0, then changed to 1.
+ * @return Scaled pixbuf.
+ **/
+GdkPixbuf *
+e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, int width, int height)
+{
+	g_return_val_if_fail (pixbuf != NULL, NULL);
+
+	if (width <= 0)
+		width = 1;
+
+	if (height <= 0)
+		height = 1;
+
+#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
+	return gnome_thumbnail_scale_down_pixbuf (pixbuf, width, height);
+#else
+	return gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
+#endif
+}
Index: e-util/e-icon-factory.h
===================================================================
--- e-util/e-icon-factory.h	(revision 34396)
+++ e-util/e-icon-factory.h	(working copy)
@@ -55,4 +55,6 @@
 
 GList     *e_icon_factory_get_icon_list     (const char *icon_name);
 
+GdkPixbuf *e_icon_factory_pixbuf_scale      (GdkPixbuf *pixbuf, int width, int height);
+
 #endif /* _E_ICON_FACTORY_H_ */
Index: widgets/misc/e-spinner.c
===================================================================
--- widgets/misc/e-spinner.c	(revision 34396)
+++ widgets/misc/e-spinner.c	(working copy)
@@ -41,6 +41,8 @@
 #include <gtk/gtkiconfactory.h>
 #include <gtk/gtksettings.h>
 
+#include "e-util/e-icon-factory.h"
+
 /* Spinner cache implementation */
 
 #define E_TYPE_SPINNER_CACHE			(e_spinner_cache_get_type())
@@ -222,8 +224,7 @@
 
 	if (pw != dw || ph != dh)
 	{
-		result = gdk_pixbuf_scale_simple (pixbuf, dw, dh,
-						  GDK_INTERP_BILINEAR);
+		result = e_icon_factory_pixbuf_scale (pixbuf, dw, dh);
 		g_object_unref (pixbuf);
 		return result;
 	}
Index: widgets/misc/ChangeLog
===================================================================
--- widgets/misc/ChangeLog	(revision 34396)
+++ widgets/misc/ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #488213
+
+	* e-spinner.c: (scale_to_size):
+	* e-image-chooser.c: (set_image_from_data):
+	* e-attachment-bar.c: (e_attachment_bar_create_attachment_cache),
+	(update):
+	Use global function e_icon_factory_pixbuf_scale for scaling pixbufs.
+
 2007-10-09  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fixes part of bug #437579
Index: widgets/misc/e-image-chooser.c
===================================================================
--- widgets/misc/e-image-chooser.c	(revision 34396)
+++ widgets/misc/e-image-chooser.c	(working copy)
@@ -34,6 +34,7 @@
 
 #include "e-image-chooser.h"
 #include "e-util/e-util-marshal.h"
+#include "e-util/e-icon-factory.h"
 
 struct _EImageChooserPrivate {
 
@@ -292,9 +293,7 @@
 
 			printf ("new scaled dimensions = (%d,%d)\n", new_width, new_height);
 
-			scaled = gdk_pixbuf_scale_simple (pixbuf,
-							  new_width, new_height,
-							  GDK_INTERP_BILINEAR);
+			scaled = e_icon_factory_pixbuf_scale (pixbuf, new_width, new_height);
 
 			composite = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, gdk_pixbuf_get_bits_per_sample (pixbuf),
 						    chooser->priv->image_width, chooser->priv->image_height);
Index: widgets/misc/e-attachment-bar.c
===================================================================
--- widgets/misc/e-attachment-bar.c	(revision 34396)
+++ widgets/misc/e-attachment-bar.c	(working copy)
@@ -241,7 +241,7 @@
 				}
 			}
 			
-			attachment->pixbuf_cache = gdk_pixbuf_scale_simple (pixbuf, width,height,GDK_INTERP_BILINEAR);
+			attachment->pixbuf_cache = e_icon_factory_pixbuf_scale (pixbuf, width, height);
 			pixbuf = attachment->pixbuf_cache;
 			g_object_ref(pixbuf);
 		} else {
@@ -334,8 +334,7 @@
 					}
 				}
 				
-				attachment->pixbuf_cache = gdk_pixbuf_scale_simple (pixbuf, width, height,
-										    GDK_INTERP_BILINEAR);
+				attachment->pixbuf_cache = e_icon_factory_pixbuf_scale (pixbuf, width, height);
 				pixbuf = attachment->pixbuf_cache;
 				g_object_ref (pixbuf);
 			} else {
