[Digikam-devel] extragear/graphics/digikam/utilities/cameragui

Gilles Caulier caulier.gilles at free.fr
Wed Sep 26 16:18:20 BST 2007


SVN commit 502937 by cgilles:

digikam from trunk : USM camera interface. Get Camera item thumnails using .thm files (very small thumbnail files) if exists. This way is more speed than dcraw parse utility.

Tom, this change is very important to support better USM camera. This commit is very simple to backport on stable branch... 

CCMAIL: digikam-devel at kde.org, tomalbers at kde.nl?

 M  +15 -4     umscamera.cpp  


--- trunk/extragear/graphics/digikam/utilities/cameragui/umscamera.cpp #502936:502937
@@ -167,7 +167,7 @@
 {
     d->cancel = false;
 
-    // Trying to get thumbnail from Exif data.
+    // In 1st, we trying to get thumbnail from Exif data if we are JPEG file.
 
     KExifData exifData;
     
@@ -178,10 +178,21 @@
            return true;
     }
 
-    // TODO: check for thm files if we didn't manage to get thumbnail from exif
+    // In 2th, we trying to get thumbnail from '.thm' files if we didn't manage to get 
+    // thumbnail from Exif. Any cameras provides *.thm files like JPEG files with RAW files. 
+    // Using this way is always more speed than using dcraw parse utility.
+    // 2006/27/01 - Gilles - Tested with my Minolta Dynax 5D USM camera.
 
-    // Trying to get thumbnail from RAW file using dcraw parse utility.
+    QFileInfo fi(folder + "/" + itemName);
 
+    if (thumbnail.load(folder + "/" + fi.baseName() + ".thm"))
+    {
+        if (!thumbnail.isNull())
+           return true;
+    }
+
+    // In 3rd we trying to get thumbnail from RAW files using dcraw parse utility.
+
     KTempFile thumbFile(QString::null, "camerarawthumb");
     thumbFile.setAutoDelete(true);
     DcrawParse rawFileParser;
@@ -197,7 +208,7 @@
         }
     }
 
-    // Trying to get thumbnail using DImg.
+    // Finaly, we trying to get thumbnail using DImg API. This way can take a while.
     // TODO : in the future, we need to use a new DImg::getEmbeddedThumbnail() method instead !
 
     DImg dimgThumb(QFile::encodeName(folder + "/" + itemName));



More information about the Digikam-devel mailing list