Re: [evolution-patches] Re: [Evolution-hackers] Patch for image scale down



Le mer 08/10/2003 à 14:46, Not Zed a écrit :
> > Ok, I wasn't clear enough :
> > 
> > to fix the scaling performance on very big images to do thumbnails, you
> > can either :
> > -use gnome-thumbnail_scale_down_pixbuf which is in libgnomeui >= 2.2 (I
> > could also copy/paste the function code which is only using gdk-pixbuf
> > 2.0 code), which can be up to 100x faster than gdk_pixbuf_scale_simple
> > in these cases. So we only need gtk+ 2.0 in this case.
> > -use gdk_pixbuf_loader_set_size call, which was introduced in gtk+ 2.2
> > and will require more changes in the code, since loader is used for
> > loading both full size and thumbnail image.
> Hmm, I think in head it's generated separately, but i can't really
> remember.  An approach at the loader level might be more appropriate,
> and it already depends on newer libs anyway.  But that depends on if
> its generated separately.

I've just did a similar fix for HEAD.. See patch attached

> > > FWIW i tested the test message on the bug, and i didn't see what i
> > > would've considered any more delay than i'd expect for such a large
> > > image - 1/2 to 1 second was all to build the thumbnail.
> > 
> > Well, you must have a very fast system or with a lot of memory (I'm not
> > sure which factor is the most important) :
> > on my test system (PIII/450) , it takes :
> > -1min25s to render thumbnail with gdk_pixbuf_scale_simple 
> > -2s with gnome_thumbnail_scale_pixbuf 
> > 
> > I think we have a winner here :)
> Although i do have a fast box, with plenty of ram (pentium-m 1.5Ghz,
> 512MB/ram), that difference seems 'quite a lot'.  I wonder if there's
> some other reason its fast enough on this box.

It is probably a memory problem, due to matrix computation done by
gdk-pixbuf..

> > I've fixed this in the new attached patch..
> 
> Ok, It looks ok to me, for 1.4 at least.

Can I commit it to 1.4 branch ? (sorry, I don't remember if I need two
reviews or only one, I've confusing with mozilla policy :))


-- 
Frederic Crozat <fcrozat mandrakesoft com>
Mandrakesoft
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/ChangeLog,v
retrieving revision 1.1228
diff -u -r1.1228 ChangeLog
--- ChangeLog	4 Sep 2003 14:47:29 -0000	1.1228
+++ ChangeLog	8 Oct 2003 15:03:06 -0000
@@ -1,3 +1,7 @@
+2003-10-08  Frederic Crozat  <fcrozat mandrakesoft com>
+
+	* configure.in: Check for gnome-thumbnail.h existence.
+
 2003-09-04  Dan Winship  <danw ximian com>
 
 	* camel.pc.in (Requires): 
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.603
diff -u -r1.603 configure.in
--- configure.in	16 Sep 2003 21:06:26 -0000	1.603
+++ configure.in	8 Oct 2003 15:03:06 -0000
@@ -1088,6 +1088,7 @@
 CPPFLAGS_save="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I libgnomeui-2.0`"
 AC_CHECK_HEADERS(libgnomeui/gnome-icon-lookup.h)
+AC_CHECK_HEADERS(libgnomeui/gnome-thumbnail.h)
 CPPFLAGS="$CPPFLAGS_save"
 
 dnl --- Flags for the various libraries we build
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2828
diff -u -r1.2828 ChangeLog
--- mail/ChangeLog	6 Oct 2003 18:42:27 -0000	1.2828
+++ mail/ChangeLog	8 Oct 2003 15:03:07 -0000
@@ -1,3 +1,9 @@
+2003-10-08  Frederic Crozat  <fcrozat mandrakesoft com>
+
+	* em-icon-stream.c: (emis_sync_close):
+        Use gnome-thumbnail_scale_down_pixbuf if available,
+        for better performance.
+
 2003-10-06  Jeffrey Stedfast  <fejj ximian com>
 
 	* mail-config-druid.c (identity_prepare): Fixed.
Index: mail/em-icon-stream.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-icon-stream.c,v
retrieving revision 1.2
diff -u -r1.2 em-icon-stream.c
--- mail/em-icon-stream.c	17 Sep 2003 21:19:02 -0000	1.2
+++ mail/em-icon-stream.c	8 Oct 2003 15:03:07 -0000
@@ -28,6 +28,9 @@
 #include <stdio.h>
 #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"
 
@@ -165,7 +168,11 @@
 			}
 		}
 
+#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
 		gtk_image_set_from_pixbuf(emis->image, mini);
 		g_object_unref(mini);
 	} else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]