[Digikam-devel] extragear/graphics/digikamimageplugins/common/cimgiface

Gilles Caulier caulier.gilles at free.fr
Fri Jul 22 09:28:48 BST 2005


SVN commit 437528 by cgilles:

digiKam CImg interface bugfix:

since this interface use common TheadedFilter class, the BlowUp plugin have been broken. TheadedFilter class use the same destination image size that original. This is not true for Blowup witch change image size. This commit fix this problem to reimplement virtual method CImgIface::initFilter() properly.

Nota: this problem do not exist with DigikamImagePlugins 0.7.3 !

CCMAIL: digikam-devel at kde.org

 M  +33 -1     cimgiface.cpp  
 M  +1 -0      cimgiface.h  


--- trunk/extragear/graphics/digikamimageplugins/common/cimgiface/cimgiface.cpp #437527:437528
@@ -82,9 +82,14 @@
     m_linear     = linearInterpolation;
 
     if (m_resize)
+        {
         m_destImage.create(newWidth, newHeight, 32);
+        kdDebug() << "CimgIface::m_resize is on, new size: (" << newWidth << ", " << newHeight << ")" << endl;
+        }
     else 
+        {
         m_destImage.create(m_orgImage.width(), m_orgImage.height(), 32);
+        }
     
     m_tmpMaskFile = QString::null;
     
@@ -112,6 +117,28 @@
        }
 }
 
+// We re-implemente this method from ThreadedFilter class because
+// target image size can be different from original if m_resize is enable.
+
+void CimgIface::initFilter(void)
+{
+    if (m_orgImage.width() && m_orgImage.height())
+       {
+       if (m_parent)
+          start();             // m_parent is valide, start thread ==> run()
+       else
+          startComputation();  // no parent : no using thread.
+       }
+    else  // No image data 
+       {
+       if (m_parent)           // If parent then send event about a problem.
+          {
+          postProgress(0, false, false);
+          kdDebug() << m_name << "::No valid image data !!! ..." << endl;
+          }
+       }
+}
+
 void CimgIface::cleanupFilter(void)
 {
     cleanup();
@@ -287,7 +314,12 @@
                  << "x" << m_destImage.height() << ")!" << endl;
        return false;
        }
-
+    else 
+       {
+       kdDebug() << "Output geometry (" << m_destImage.width() 
+                 << "x" << m_destImage.height() << ")" << endl;
+       }
+              
     mask = CImg<uchar>(img.dimx(), img.dimy(), 1, 1, 255);
     mask.resize(m_destImage.width(), m_destImage.height(), 1, 1, 1);
     img0 = img.get_resize(m_destImage.width(), m_destImage.height(), 1, -100, 1);
--- trunk/extragear/graphics/digikamimageplugins/common/cimgiface/cimgiface.h #437527:437528
@@ -86,6 +86,7 @@
 
 private:  // CImg filter interface.
 
+    virtual void initFilter(void);
     virtual void filterImage(void);
     virtual void cleanupFilter(void);
     



More information about the Digikam-devel mailing list