[Digikam-devel] [Bug 127272] crash when opening image in IE
Gilles Caulier
caulier.gilles at free.fr
Sun May 14 11:16:32 BST 2006
------- 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=127272
------- Additional Comments From caulier.gilles free fr 2006-05-14 12:16 -------
SVN commit 540631 by cgilles:
digikam from trunk : missing exception management with Exiv2 into DMetadata::getExif() and DMetadata::getIptc() methods.
Please report me if this commit fix your problem.
CCMAIL: francisco.jct gmail com
CCBUGS: 127272
M +38 -10 dmetadata.cpp
--- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #540630:540631
@ -86,20 +86,48 @
QByteArray DMetadata::getExif() const
{
- Exiv2::ExifData exif(d->exifMetadata);
- Exiv2::DataBuf const c2(exif.copy());
- QByteArray data(c2.size_);
- memcpy(data.data(), c2.pData_, c2.size_);
- return data;
+ try
+ {
+ if (!d->exifMetadata.empty())
+ {
+ Exiv2::ExifData exif(d->exifMetadata);
+ Exiv2::DataBuf const c2(exif.copy());
+ QByteArray data(c2.size_);
+ memcpy(data.data(), c2.pData_, c2.size_);
+ return data;
+ }
+ }
+ catch( Exiv2::Error &e )
+ {
+ kdDebug() << "Cannot get Exif data using Exiv2 ("
+ << QString::fromLocal8Bit(e.what().c_str())
+ << ")" << endl;
+ }
+
+ return QByteArray();
}
QByteArray DMetadata::getIptc() const
{
- Exiv2::IptcData iptc(d->iptcMetadata);
- Exiv2::DataBuf const c2(iptc.copy());
- QByteArray data(c2.size_);
- memcpy(data.data(), c2.pData_, c2.size_);
- return data;
+ try
+ {
+ if (!d->iptcMetadata.empty())
+ {
+ Exiv2::IptcData iptc(d->iptcMetadata);
+ Exiv2::DataBuf const c2(iptc.copy());
+ QByteArray data(c2.size_);
+ memcpy(data.data(), c2.pData_, c2.size_);
+ return data;
+ }
+ }
+ catch( Exiv2::Error &e )
+ {
+ kdDebug() << "Cannot get Iptc data using Exiv2 ("
+ << QString::fromLocal8Bit(e.what().c_str())
+ << ")" << endl;
+ }
+
+ return QByteArray();
}
void DMetadata::setComments(const QByteArray& data)
More information about the Digikam-devel
mailing list