fix ModifyDate

This commit is contained in:
Anna 2024-04-18 15:12:42 +02:00 committed by GitHub
parent 46531c7eca
commit a1eaa8f64e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,6 +29,7 @@
#include "imagedata.h" #include "imagedata.h"
#include "../rtgui/version.h" #include "../rtgui/version.h"
#include "../rtgui/pathutils.h" #include "../rtgui/pathutils.h"
#include <ctime>
#if EXIV2_TEST_VERSION(0,28,0) #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; 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_exif_pairs(dst->exifData());
import_iptc_pairs(dst->iptcData()); import_iptc_pairs(dst->iptcData());
bool xmp_tried = false; bool xmp_tried = false;