From kde-commits Wed Dec 22 05:38:29 2010 From: Miika Turkia Date: Wed, 22 Dec 2010 05:38:29 +0000 To: kde-commits Subject: extragear/graphics/kphotoalbum Message-Id: <20101222053829.98096AC8AA () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129299635127577 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 + + * Fixed bugs #255286 and #237889, crashes on missing exif information + 2010-10-22 Jesper K. Pedersen * 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 ); }