aports/testing/lomiri-gallery-app/0001-update-for-newer-Exiv2-version.patch
Aster Boese c454bbd998 */*: update name and email and add contributor field
Brandon Boese <brandonboese@protonmail.com>
-->
Aster Boese <asterboese@mailbox.org>
2025-03-13 05:58:42 +00:00

66 lines
2.3 KiB
Diff

From ab358e7a51375945c1f6119a08ce5ccc03bce34a Mon Sep 17 00:00:00 2001
From: Aster Boese <asterboese@mailbox.org>
Date: Sun, 31 Dec 2023 14:07:54 -0500
Subject: [PATCH] update for newer Exiv2 version
---
src/photo/photo-metadata.cpp | 8 ++++----
src/photo/photo-metadata.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/photo/photo-metadata.cpp b/src/photo/photo-metadata.cpp
index ac4a0b05..f9a08ae8 100644
--- a/src/photo/photo-metadata.cpp
+++ b/src/photo/photo-metadata.cpp
@@ -134,7 +134,7 @@ PhotoMetadata* PhotoMetadata::fromFile(const char* filepath)
result->m_keysPresent.insert(QString(i->key().c_str()));
return result;
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
qDebug("Error loading image metadata: %s", e.what());
delete result;
return NULL;
@@ -165,7 +165,7 @@ Orientation PhotoMetadata::orientation() const
if (m_keysPresent.find(EXIF_ORIENTATION_KEY) == m_keysPresent.end())
return DEFAULT_ORIENTATION;
- long orientation_code = exif_data[EXIF_ORIENTATION_KEY].toLong();
+ long orientation_code = exif_data[EXIF_ORIENTATION_KEY].toUint32();
if (orientation_code < MIN_ORIENTATION || orientation_code > MAX_ORIENTATION)
return DEFAULT_ORIENTATION;
@@ -244,7 +244,7 @@ void PhotoMetadata::setDateTimeDigitized(const QDateTime& digitized)
if (!m_keysPresent.contains(EXIF_DATETIMEDIGITIZED_KEY))
m_keysPresent.insert(EXIF_DATETIMEDIGITIZED_KEY);
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
qDebug("Do not set DateTimeDigitized, error reading image metadata; %s", e.what());
return;
}
@@ -259,7 +259,7 @@ bool PhotoMetadata::save() const
try {
m_image->writeMetadata();
return true;
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
return false;
}
}
diff --git a/src/photo/photo-metadata.h b/src/photo/photo-metadata.h
index a2687b8d..97f27acd 100644
--- a/src/photo/photo-metadata.h
+++ b/src/photo/photo-metadata.h
@@ -59,7 +59,7 @@ public:
private:
PhotoMetadata(const char* filepath);
- Exiv2::Image::AutoPtr m_image;
+ Exiv2::Image::UniquePtr m_image;
QSet<QString> m_keysPresent;
QFileInfo m_fileSourceInfo;
};
--
2.43.0