Bug 201560

Summary: Crash at start up when scanning images
Product: [Applications] digikam Reporter: stefan.asserhall
Component: Database-ScanAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: marcel.wiesweg
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.0

Description stefan.asserhall 2009-07-26 14:39:35 UTC
Version:           1.0.0-beta4 (rev.: 1002376M) (using 4.3.61 (KDE 4.3.61 (KDE 4.4 >= 20090717)), compiled sources)
Compiler:          gcc
OS:                Linux (i686) release 2.6.26.8-57.fc8

digiKam crashes at start up when scanning images. The crash occurs in the file digikam/libs/database/imagescanner.cpp:378, probably because some image has incorrect metadata. The following patch fixes the crash:

Index: libs/database/imagescanner.cpp
===================================================================
--- libs/database/imagescanner.cpp	(revision 1002376)
+++ libs/database/imagescanner.cpp	(arbetskopia)
@@ -373,13 +373,13 @@
     }
 
     // Headline
-    if (!metadataInfos[0].isNull())
+    if (!metadataInfos[0].isNull() && metadataInfos[0].canConvert(QVariant::String))
     {
         comments.addHeadline(metadataInfos[0].toString());
     }
 
     // Title
-    if (!metadataInfos[1].isNull())
+    if (!metadataInfos[1].isNull() && metadataInfos[1].canConvert(QVariant::String))
     {
         comments.addTitle(metadataInfos[1].toString());
     }
Comment 1 caulier.gilles 2009-07-26 14:46:43 UTC
Marcel,

This one is for you (:=)))

Gilles Caulier
Comment 2 Marcel Wiesweg 2009-07-26 17:40:04 UTC
Can you send me (private email address) the picture causing the crash? The filename is probably the last one printed on the console (from dimg loading or whatever). Thanks!
Comment 3 Marcel Wiesweg 2009-07-27 16:46:59 UTC
Stefan reported this as fixed by private mail