[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/kphotoalbum
From:       Miika Turkia <miika.turkia () gmail ! com>
Date:       2010-12-22 5:38:29
Message-ID: 20101222053829.98096AC8AA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1208526 by mturkia:

Fixed bugs #255286 and #237889, crashes on missing exif information


 M  +4 -0      ChangeLog  
 M  +3 -1      DB/FileInfo.cpp  
 M  +3 -0      Exif/DatabaseElement.cpp  


--- trunk/extragear/graphics/kphotoalbum/ChangeLog #1208525:1208526
@@ -1,3 +1,7 @@
+2010-12-22  Miika Turkia <miika.turkia@gmail.com>
+
+	* Fixed bugs #255286 and #237889, crashes on missing exif information
+
 2010-10-22  Jesper K. Pedersen  <blackie@kdab.com>
 
 	* Added "Export by symlink" to the export dialog. Thanks to Robert
--- trunk/extragear/graphics/kphotoalbum/DB/FileInfo.cpp #1208525:1208526
@@ -86,7 +86,9 @@
     if ( map.findKey( Exiv2::ExifKey( "Exif.Image.Orientation" ) ) != map.end() ) {
         const Exiv2::Exifdatum& datum = map["Exif.Image.Orientation"];
 
-        int orientation =  datum.toLong();
+        int orientation = 0;
+        if (datum.count() > 0)
+            orientation =  datum.toLong();
         _angle = orientationToAngle( orientation );
     }
 
--- trunk/extragear/graphics/kphotoalbum/Exif/DatabaseElement.cpp #1208525:1208526
@@ -70,7 +70,10 @@
 
 void Exif::IntExifElement::bindValues( QSqlQuery* query, int& counter, Exiv2::ExifData& data )
 {
+    if (data[_tag].count() > 0)
     query->bindValue( counter++, (int) data[_tag].toLong() );
+    else
+        query->bindValue( counter++, (int) 0 );
 }
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic