Patch-Source: https://gitlab.archlinux.org/archlinux/packaging/packages/kphotoalbum/-/blob/ad00a492ca37a83c1d35d96480d64fe53966f00c/exiv2-0.28.patch -- diff --git a/DB/FileInfo.cpp b/DB/FileInfo.cpp index dc4c9819..a04e2c0f 100644 --- a/DB/FileInfo.cpp +++ b/DB/FileInfo.cpp @@ -13,6 +13,8 @@ #include #include +#include + using namespace DB; FileInfo FileInfo::read(const DB::FileName &fileName, DB::ExifMode mode) @@ -80,7 +82,11 @@ void DB::FileInfo::parseEXIV2(const DB::FileName &fileName) int orientation = 0; if (datum.count() > 0) +#if EXIV2_TEST_VERSION(0,28,0) + orientation = datum.toUint32(); +#else orientation = datum.toLong(); +#endif m_angle = orientationToAngle(orientation); } diff --git a/lib/kpaexif/Database.cpp b/lib/kpaexif/Database.cpp index 4d0e228c..c34250ac 100644 --- a/lib/kpaexif/Database.cpp +++ b/lib/kpaexif/Database.cpp @@ -21,6 +21,7 @@ #include #include #include +#include using namespace Exif; @@ -320,7 +321,11 @@ bool Exif::Database::add(const DB::FileName &fileName) return false; try { +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data()); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data()); +#endif Q_ASSERT(image.get() != nullptr); image->readMetadata(); Exiv2::ExifData &exifData = image->exifData(); @@ -341,7 +346,11 @@ bool Exif::Database::add(const DB::FileNameList &list) for (const DB::FileName &fileName : list) { try { +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data()); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(fileName.absolute().toLocal8Bit().data()); +#endif Q_ASSERT(image.get() != nullptr); image->readMetadata(); map << DBExifInfo(fileName, image->exifData()); diff --git a/lib/kpaexif/DatabaseElement.cpp b/lib/kpaexif/DatabaseElement.cpp index 4e7ba198..94b3e1f8 100644 --- a/lib/kpaexif/DatabaseElement.cpp +++ b/lib/kpaexif/DatabaseElement.cpp @@ -8,6 +8,7 @@ #include #include +#include static QString replaceDotWithUnderscore(const char *cstr) { @@ -77,7 +78,11 @@ QString Exif::IntExifElement::queryString() const QVariant Exif::IntExifElement::valueFromExif(Exiv2::ExifData &data) const { if (data[m_tag].count() > 0) +#if EXIV2_TEST_VERSION(0,28,0) + return QVariant { (int)data[m_tag].toUint32() }; +#else return QVariant { (int)data[m_tag].toLong() }; +#endif else return QVariant { (int)0 }; } diff --git a/lib/kpaexif/Info.cpp b/lib/kpaexif/Info.cpp index 5f77fc81..2e7024d6 100644 --- a/lib/kpaexif/Info.cpp +++ b/lib/kpaexif/Info.cpp @@ -166,7 +166,11 @@ Info::Info() void Exif::writeExifInfoToFile(const DB::FileName &srcName, const QString &destName, const QString &imageDescription) { // Load Exif from source image +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(QFile::encodeName(srcName.absolute()).data()); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(QFile::encodeName(srcName.absolute()).data()); +#endif image->readMetadata(); Exiv2::ExifData data = image->exifData(); @@ -201,7 +205,11 @@ Exif::Metadata Exif::Info::metadata(const DB::FileName &fileName) { try { Exif::Metadata result; +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(QFile::encodeName(fileName.absolute()).data()); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(QFile::encodeName(fileName.absolute()).data()); +#endif Q_ASSERT(image.get() != nullptr); image->readMetadata(); result.exif = image->exifData();