gdk_pixbuf_scale offset wrong for scales != 2**n
Submitted by Dov Grobgeld
Link to original bug (#389832)
Description
Please describe the problem: There is a problem in the pixel-offset of images scaled by a large factor. I have only been able to reproduce the problem for scales!=2**n. To illustrate the problem I have created a program that does the following:
-
creates a 256x256 image where each pixel has its red channel corresponding to the column, the green channel to the row, and the blue channel creates a checker pattern.
-
This image is scaled by a factor of 75 (non-power of two) and clipped by the gdk_pixbuf_scale() function to create a 512x512 image that is a zoomed up image of the first image where the left-upper corner of the second image is at position (128,0) of the first image.
-
Both images are written to disk in ppm format under the names org.ppm and simg.ppm respectively.
It is expeced that simg.ppm will be aligned on the checker pattern that exists in org.ppm, but it is offset by approx 9 pixels.
Steps to reproduce:
Actual results:
Expected results:
Does this happen every time?
Other information:
Version: git master