libgimp/gimptilebackendplugin.c provides no pyramid
@Jehan
Submitted by Jehan Link to original bug (#690265)
Description
If the scale value is <= 0.5, the buffer is not scaled as expected.
I have a piece of code which works as expected for any scale > 0.5 (scale down or up), but as soon as I try scale <= 0.5, the resulting image in the destination buffer is bigger than expected.
In gegl/buffer/gegl-buffer-access.c : gegl_buffer_get_unlocked(), there is this piece of code:
while (scale <= 0.5)
{
scale *= 2;
factor *= 2;
level++;
}
If I simply comment it out, the scaling under 0.5 suddenly works as expected. So this level thing is broken somewhere. But I guess it must have been done this way for a reason (more efficient way to scale up by factors of 2, I imagine?) so removing this part is not the right fix.
I don't know if this fails in every case. Here is the flow I followed for mine: This computed level is used in gegl_buffer_iterate_read_dispatch() > gegl_buffer_iterate_read_abyss_none() > gegl_tile_source_get_tile ().
I see at some point it calls get_tile() from gegl/buffer/gegl-tile-handler-zoom.c. But as it get the tile from the source (cache in my case), it returned directly and did not do anything with z. Considering the name of this tile source (GeglTileHandlerZoom), does it mean the scale to half should happen at this point? I wanted to fix, but I definitely don't know well enough yet GEGL code and logics to understand where the level value is supposed to be handled (because right now, it seems it never is). If I could get some pointer, would be nice (or of course, you can fix, but I'd like to understand GEGL code better too).
Version: git master