[Digikam-devel] [Bug 152192] resize really bad qualitatively

Gilles Caulier caulier.gilles at gmail.com
Wed Nov 21 08:54:07 GMT 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=152192         




------- Additional Comments From caulier.gilles gmail com  2007-11-21 09:54 -------
To be clean in digiKam code about CImg, i have contacted David Tschumperlé (Cimg author) to have tips around this problem. 

Sound like we cannot use directly a simple CImg::resize(), but an iteration of progressive half resizements :

void GreycstorationIface::simpleResize()
{
    const unsigned int method = 3;      // Initial estimate (0, none, 1=block, 3=linear, 4=grid, 5=bicubic).

    int w = m_destImage.width();
    int h = m_destImage.height();

    while (d->img.dimx() > 2*w &&
           d->img.dimy() > 2*h)
    {
        d->img.resize_halfXY();
    }

    d->img.resize(w, h, -100, -100, method);
}

I have patched my Digikam::CImg interface and now result is similar than others algorithm...

Gilles... Who love clean code (:=)))



More information about the Digikam-devel mailing list