From a1eaa8f64e803d8bf884787f0ef3e56b8e920b9c Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 18 Apr 2024 15:12:42 +0200 Subject: [PATCH 1/3] fix ModifyDate --- rtengine/metadata.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtengine/metadata.cc b/rtengine/metadata.cc index 0a55c1424..2e75e1f3c 100644 --- a/rtengine/metadata.cc +++ b/rtengine/metadata.cc @@ -29,6 +29,7 @@ #include "imagedata.h" #include "../rtgui/version.h" #include "../rtgui/pathutils.h" +#include #if EXIV2_TEST_VERSION(0,28,0) @@ -312,6 +313,13 @@ void Exiv2Metadata::saveToImage(const Glib::ustring &path, bool preserve_all_tag } dst->exifData()["Exif.Image.Software"] = "RawTherapee " RTVERSION; + + std::time_t t = std::time(nullptr); + char mbstr[100]; + if (std::strftime(mbstr, sizeof(mbstr), "%Y:%m:%d %H:%M:%S", std::localtime(&t))) { + dst->exifData()["Exif.Image.ModifyDate"] = mbstr; + } + import_exif_pairs(dst->exifData()); import_iptc_pairs(dst->iptcData()); bool xmp_tried = false; From 1aea652fea98df0268161bb84ff2f1dbd976973a Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 18 Apr 2024 16:48:08 +0200 Subject: [PATCH 2/3] Add correct DateTime (editing date) to Exif data Currently, RT does not save the editing date (Exif tag DateTime) in the exif data of the exported files, only DateTimeOriginal (the date/time the photo was captured). This patch fixes this. --- rtengine/metadata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/metadata.cc b/rtengine/metadata.cc index 2e75e1f3c..38d115b7e 100644 --- a/rtengine/metadata.cc +++ b/rtengine/metadata.cc @@ -317,7 +317,7 @@ void Exiv2Metadata::saveToImage(const Glib::ustring &path, bool preserve_all_tag std::time_t t = std::time(nullptr); char mbstr[100]; if (std::strftime(mbstr, sizeof(mbstr), "%Y:%m:%d %H:%M:%S", std::localtime(&t))) { - dst->exifData()["Exif.Image.ModifyDate"] = mbstr; + dst->exifData()["Exif.Image.DateTime"] = mbstr; } import_exif_pairs(dst->exifData()); From b7749c0719c8e8e058b38a07a454df5c10eebd6f Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 2 May 2024 09:59:47 +0200 Subject: [PATCH 3/3] Add correct DateTime to Exif date --- rtengine/metadata.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/metadata.cc b/rtengine/metadata.cc index 38d115b7e..1e0962dd2 100644 --- a/rtengine/metadata.cc +++ b/rtengine/metadata.cc @@ -315,9 +315,9 @@ void Exiv2Metadata::saveToImage(const Glib::ustring &path, bool preserve_all_tag dst->exifData()["Exif.Image.Software"] = "RawTherapee " RTVERSION; std::time_t t = std::time(nullptr); - char mbstr[100]; + char mbstr[20]; if (std::strftime(mbstr, sizeof(mbstr), "%Y:%m:%d %H:%M:%S", std::localtime(&t))) { - dst->exifData()["Exif.Image.DateTime"] = mbstr; + dst->exifData()["Exif.Image.DateTime"] = mbstr; } import_exif_pairs(dst->exifData());