[Kde-imaging] extragear/graphics/kipi-plugins

Valerio Fuoglio valerio.fuoglio at gmail.com
Tue Nov 4 21:35:40 CET 2008


SVN commit 880130 by vfuoglio:

Added RAW images support to SlideShow.

CCMAIL: kde-imaging at kde.org
BUG: 157285 



 M  +3 -1      NEWS  
 M  +1 -1      slideshow/CMakeLists.txt  
 M  +27 -3     slideshow/imageloadthread.cpp  
 M  +31 -12    slideshow/slideshowloader.cpp  


--- trunk/extragear/graphics/kipi-plugins/NEWS #880129:880130
@@ -7,13 +7,15 @@
 AcquireImages  : Under Windows, TWAIN interface is used to scan image using flat scanner.
 SlideShow      : Normal effects are back.
 SlideShow      : New effect "Cubism".
+SlideShow      : Added support for RAW images.
 
 Kipi-plugins BUG FIXING from B.K.O (http://bugs.kde.org):
 
 001 ==> 172910 : GalleryExport      : Gallery crash (letting crash digiKam) with valid data and url.
 002 ==> 161855 : GalleryExport      : Remote Gallery Sync loses password.
 003 ==> 154752 : GalleryExport      : Export to Gallery2 seems to fail, but in fact works.
-004 ==> 
+004 ==> 157285 : SlideShow          : digikam advanced slideshow not working with Canon RAWs 
+005 ==>
 
 v 0.2.0 - beta3
 ------------------------------------------------------------------------
--- trunk/extragear/graphics/kipi-plugins/slideshow/CMakeLists.txt #880129:880130
@@ -51,7 +51,7 @@
                      )
 
 KDE4_INSTALL_ICONS(${ICON_INSTALL_DIR})
-install(FILES KIPIicon.svg DESTINATION ${DATA_INSTALL_DIR}//kipiplugin_slideshow/)
+INSTALL(FILES KIPIicon.svg DESTINATION ${DATA_INSTALL_DIR}//kipiplugin_slideshow/)
 
 INSTALL(TARGETS kipiplugin_slideshow DESTINATION ${PLUGIN_INSTALL_DIR})
 
--- trunk/extragear/graphics/kipi-plugins/slideshow/imageloadthread.cpp #880129:880130
@@ -30,12 +30,22 @@
 
 #include <Q3ValueList>
 #include <QMatrix>
+#include <QFileInfo>
 
 // KDE includes.
 
 #include <klocale.h>
 #include <kdebug.h>
 
+// LibKDcraw includes
+
+#include <libkdcraw/version.h>
+#include <libkdcraw/kdcraw.h>
+
+#if KDCRAW_VERSION < 0x000400
+#include <libkdcraw/dcrawbinary.h>
+#endif
+
 // Local includes.
 
 #include "slideshowkb.h"
@@ -154,10 +164,24 @@
     QPair<QString, int> fileAngle = m_fileList[m_fileIndex];
     QString path(fileAngle.first);
     int     angle(fileAngle.second);
-    QImage image(path);
+    
+    QImage image;
+    
+    // check if it's a RAW file.
+#if KDCRAW_VERSION < 0x000400
+    QString rawFilesExt(KDcrawIface::DcrawBinary::instance()->rawFiles());
+#else
+    QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
+#endif
+    QFileInfo fileInfo(path);
+    if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() )) {
+        // it's a RAW file, use the libkdcraw loader
+        KDcrawIface::KDcraw::loadDcrawPreview(image, path);
+    } else {
+        // use the standard loader
+        image=QImage(path);
+    }
 
-
-
     if (angle != 0)
     {
         QMatrix wm;
--- trunk/extragear/graphics/kipi-plugins/slideshow/slideshowloader.cpp #880129:880130
@@ -24,15 +24,26 @@
 
 // Qt includes.
 
-#include <qimage.h>
-#include <qmatrix.h>
-#include <qpainter.h>
-#include <q3valuelist.h>
+#include <QImage>
+#include <QMatrix>
+#include <QPainter>
+#include <Q3ValueList>
+#include <QFileInfo>
 
 // KDE includes.
 
 #include <kdebug.h>
 
+// LibKDcraw includes
+
+#include <libkdcraw/version.h>
+#include <libkdcraw/kdcraw.h>
+
+#if KDCRAW_VERSION < 0x000400
+#include <libkdcraw/dcrawbinary.h>
+#endif
+
+
 namespace KIPISlideShowPlugin
 {
 
@@ -54,10 +65,24 @@
 
 void LoadThread::run()
 {
+    QImage newImage;
+    
+    // check if it's a RAW file.
+#if KDCRAW_VERSION < 0x000400
+    QString rawFilesExt(KDcrawIface::DcrawBinary::instance()->rawFiles());
+#else
+    QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
+#endif
+    QFileInfo fileInfo(m_path.path());
+    if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() )) {
+        // it's a RAW file, use the libkdcraw loader
+        KDcrawIface::KDcraw::loadDcrawPreview(newImage, m_path.path());
+    } else {
+        // use the standard loader
+        newImage=QImage(m_path.path());
+    }
 
-    QImage newImage(m_path.path());
     // Rotate according to angle
-
     if ( m_angle != 0 )
     {
         QMatrix matrix;
@@ -126,12 +151,6 @@
 
     m_threadLock->unlock();
 
-
-//    delete(m_loadingThreads);
-//    delete(m_loadedImages);
-//
-//    delete(m_imageLock);
-//    delete(m_threadLock);
 }
 
 void SlideShowLoader::next()


More information about the Kde-imaging mailing list