After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667120 - gdk_pixbuf_scale_simple() slow when resizing to 1x1
gdk_pixbuf_scale_simple() slow when resizing to 1x1
Status: RESOLVED DUPLICATE of bug 336327
Product: gdk-pixbuf
Classification: Platform
Component: general
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-02 10:24 UTC by nils
Modified: 2013-03-27 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example image causing this problem (2.07 KB, image/png)
2012-01-02 10:24 UTC, nils
Details

Description nils 2012-01-02 10:24:32 UTC
Created attachment 204442 [details]
Example image causing this problem

I've created the following example to demonstrate the problem:
-----
#include <gtk/gtk.h>
#include <gdk/gdk.h>

int main(int argc,char **argv) {
	gtk_init(&argc,&argv);
	GdkPixbuf *img = gdk_pixbuf_new_from_file("dummy.png",NULL);
	GdkPixbuf *scaled = gdk_pixbuf_scale_simple(img,1,1,GDK_INTERP_BILINEAR);
	return 0;
}
-----

Timing this program gives:
$ time ./example
real	0m0.750s
user	0m0.720s
sys	0m0.020s

When I change either width or height to something else than 1, its much faster:
$ time ./example
real	0m0.021s
user	0m0.012s
sys	0m0.004s

As it seems, this happens only for 1x1 with all interpolation modes except GDK_INTERP_NEAREST. Additionally, it depends on the image. Therefore I've attached the dummy.png I'm using.

Note also that this isn't a problem that does only occur in such silly example programs, because I discovered this problem using gtkmm by reacting to on_size_allocate() of an image with a resize of that image. At the beginning on_size_allocate() is called with 1x1.
Comment 1 Christian Persch 2013-03-27 18:24:07 UTC

*** This bug has been marked as a duplicate of bug 336327 ***