[Digikam-devel] [Bug 144895] digikam crashes when dowloading from Kodak CX7300 camera

Gilles Caulier caulier.gilles at gmail.com
Wed May 2 07:42:46 BST 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=144895         




------- Additional Comments From caulier.gilles gmail com  2007-05-02 08:42 -------
SVN commit 660276 by cgilles:

libkexiv2 from trunk : test if file is readable before to load it in Exiv2.
CCBUGS: 144895


 M  +12 -8     kexiv2.cpp  
 M  +2 -2      kexiv2.h  


--- trunk/extragear/libs/libkexiv2/kexiv2.cpp #660275:660276
 @ -1,6 +1,6  @
 /* ============================================================
- * Authors: Gilles Caulier <caulier dot gilles at gmail dot com>
- *          Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Authors: Gilles Caulier 
+ *          Marcel Wiesweg 
  * Date   : 2006-09-15
  * Description : Exiv2 library interface for KDE
  *
 @ -344,13 +344,15  @
 
 bool KExiv2::load(const QString& filePath)
 {
+    QFileInfo finfo(filePath);
+    if (filePath.isEmpty() || !finfo.isReadable())
+    {
+        qDebug("File '%s' is not readable.", finfo.fileName().ascii());
+        return false;
+    }
+
     try
-    {   
-        d->filePath = filePath;
- 
-        if (filePath.isEmpty())
-            return false;
-
+    {
         Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
                                       (QFile::encodeName(filePath)));
         image->readMetadata();
 @ -367,6 +369,8  @
         
         d->iptcMetadata = image->iptcData();
 
+        d->filePath = filePath;
+
         return true;
     }
     catch( Exiv2::Error &e )
--- trunk/extragear/libs/libkexiv2/kexiv2.h #660275:660276
 @ -1,6 +1,6  @
 /* ============================================================
- * Authors: Gilles Caulier <caulier dot gilles at gmail dot com>
- *          Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
+ * Authors: Gilles Caulier 
+ *          Marcel Wiesweg 
  * Date   : 2006-09-15
  * Description : Exiv2 library interface for KDE
  *



More information about the Digikam-devel mailing list