mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 11:45:18 +03:00
87 lines
3.2 KiB
Diff
87 lines
3.2 KiB
Diff
From b1587a05371820fc1218826ba84520d94a4349fa Mon Sep 17 00:00:00 2001
|
|
From: Brandon Boese <brandonboese@protonmail.com>
|
|
Date: Thu, 12 Oct 2023 17:48:16 -0400
|
|
Subject: [PATCH 2/3] Update exiv2 includes
|
|
|
|
---
|
|
.../photoeditor/photo-image-provider.cpp | 2 +-
|
|
.../plugin/photoeditor/photo-metadata.cpp | 18 +++++++++---------
|
|
2 files changed, 10 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-image-provider.cpp b/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-image-provider.cpp
|
|
index 95d4f9f..a611a28 100644
|
|
--- a/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-image-provider.cpp
|
|
+++ b/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-image-provider.cpp
|
|
@@ -55,7 +55,7 @@ QImage PhotoImageProvider::requestImage(const QString& id,
|
|
exifData[EXIF_ORIENTATION_KEY] = (Exiv2::UShortValue)exifData[EXIF_ORIENTATION_KEY].toLong();
|
|
exivImage->writeMetadata();
|
|
}
|
|
- } catch (Exiv2::AnyError& e) {
|
|
+ } catch (Exiv2::Error& e) {
|
|
}
|
|
}
|
|
|
|
diff --git a/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-metadata.cpp b/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-metadata.cpp
|
|
index 9707bf7..a835c68 100644
|
|
--- a/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-metadata.cpp
|
|
+++ b/modules/Lomiri/Components/Extras/plugin/photoeditor/photo-metadata.cpp
|
|
@@ -55,7 +55,7 @@ const char* get_first_matched(const char* keys[], size_t n_keys,
|
|
if (in.contains(keys[i]))
|
|
return keys[i];
|
|
}
|
|
-
|
|
+
|
|
return NULL;
|
|
}
|
|
|
|
@@ -88,7 +88,7 @@ QDateTime parse_exif_date_string(const char* s) {
|
|
return QDateTime(QDate(year, month, day), QTime(hour, minute, second));
|
|
}
|
|
}
|
|
-
|
|
+
|
|
// the no argument QDateTime constructor produces an invalid QDateTime,
|
|
// which is what we want
|
|
return QDateTime();
|
|
@@ -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;
|
|
@@ -236,15 +236,15 @@ void PhotoMetadata::setDateTimeDigitized(const QDateTime& digitized)
|
|
qDebug("Do not set DateTimeDigitized, invalid image metadata.");
|
|
return;
|
|
}
|
|
-
|
|
+
|
|
Exiv2::ExifData& exif_data = m_image->exifData();
|
|
-
|
|
+
|
|
exif_data[EXIF_DATETIMEDIGITIZED_KEY] = digitized.toString("yyyy:MM:dd hh:mm:ss").toStdString();
|
|
-
|
|
+
|
|
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;
|
|
}
|
|
}
|
|
--
|
|
2.42.0
|
|
|