[Digikam-devel] [Bug 149485] Advanced image resize for the digikam editor

Julien Narboux Julien at narboux.fr
Tue Apr 7 16:52:17 BST 2009


https://bugs.kde.org/show_bug.cgi?id=149485





--- Comment #52 from Julien Narboux <Julien narboux fr>  2009-04-07 17:52:13 ---
Julien,

In theory, when we resize several times the same picture with a decreasing
amount of pixels (reduce by 100pixels, then by 90 pixels, etc). The first
resize is slow, but the other should be quick because the visibility map is
already computed by Lqr.

To test this I replaced :
lqr_carver_resize(d->carver, d->width, d->height);

by :

 time_t h1, h2;

    time (&h1);
    lqr_carver_resize(d->carver, d->width, d->height);
    time (&h2);
    printf("Duration first resize %.2lf\n", difftime(h2,h1));
    int i;
    for (i=1;i<100;i+=10)
      {
    time(&h1);
    lqr_carver_resize(d->carver, d->width+i, d->height+i);
    time(&h2);
     printf("Duration %.2lf\n", difftime(h2,h1));
      };


The result I get is :

Duration first resize 9,00
Duration 0,00
Duration 0,00
Duration 1,00
Duration 0,00
Duration 0,00
Duration 1,00
Duration 0,00
Duration 1,00
Duration 0,00
Duration 0,00

This means that the first resize takes 9 seconds, but the other ones take less
than a second as expected.

Their is something suboptimal in the plugin because if I click "try" several
times it always takes 8 or 9 seconds.

I do not undersand why. Is the constructor
ContentAwareResizer::ContentAwareResizer called each time we click on "try" ?

Julien

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list