viking icon indicating copy to clipboard operation
viking copied to clipboard

slow GeoRef drawing at high zoom levels (patch)

Open digiboule opened this issue 2 years ago • 1 comments

Thank you for this wonderful tool. I use it every single day, with many GeoRef layers of approximately 5000 x 4000 pixels.

However, when at a high level of zoom (pixelfact 2-ish) the drawing of the GeoRef layers slows to a crawl, getting worse at higher levels of zoom and sometimes taking many seconds to complete. The underlying issue seems to be that the entire image is scaled up, not just the portion visible on screen. There is a "todo" comment about this problem in vikgeoreflayer.c so it appears to be known already. Separately, there seemed to be an issue with the performance of calls to gdk_pixbuf_scale_simple at high downscaling ratios which was addressed in another package (gthumb) and I copied their solution.

I only dabble in this kind of thing but I have created a patch to solve the issue for myself, have been testing it for several years, and would now like to contribute it back to the developers and community.

Unfortunately the patch is against viking 1.7, however based on a quick glance at the latest vikgeoreflayer.c, it should be fairly trivial to adjust. I would do it myself but I have not yet tried newer versions of viking.

vikgeoreflayer-1.7-drawing.patch.txt

digiboule avatar Jun 12 '22 20:06 digiboule

Excellent, thanks for that. I don't use GeoRef layers much myself, although I just added a rotation feature which may effect this patch. However I'm a bit busy over the next couple of weeks, so I'll seek to try it out / merge it in a bit later.

rnorris avatar Jun 13 '22 19:06 rnorris

So those couple of weeks turned out somewhat longer... Unfortunately your patch did conflict with the rotation effect, since both reworked the core of the GeoRef layer drawing logic. But never fear! Finally I have managed to totally rewrite this redrawing, using your patch (thanks once again) and the gthumb reference for inspiration. Look forward to the change being uploaded soon.

rnorris avatar Nov 25 '23 19:11 rnorris