[Gimp-developer] scale-region.c

Sven Neumann sven at gimp.org
Sat Aug 23 14:53:56 PDT 2008


Hi Geert,

I have a small patch to scale-region.c that I would to have your opinion
on. I noticed that the current code sometimes does an unneeded copy
operation. This happens when the scale factor is 2^n. For example when
an image of 800x600 pixels is scaled to 400x300. The function
determine_scale() then decides that a first scale step to 400x300 needs
to be made and the result is then scaled again with a scale factor of
1.0. There's even an optimization n the scale() function for this
special case.

Attached is a patch that changes determine_scale() to avoid this extra
step. Is there anything that I am missing or do you agree that it should
be safe to apply this?


Sven


-------------- next part --------------
A non-text attachment was scrubbed...
Name: paint-funcs-scale-levels.diff
Type: text/x-patch
Size: 1489 bytes
Desc: not available
Url : /lists/gimp-developer/attachments/20080823/15e66288/attachment.bin 


More information about the Gimp-developer mailing list