summaryrefslogtreecommitdiff
path: root/src/android/jpeg/exif.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/jpeg/exif.cpp')
-rw-r--r--src/android/jpeg/exif.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
index 1ced5534..c0dbfcc2 100644
--- a/src/android/jpeg/exif.cpp
+++ b/src/android/jpeg/exif.cpp
@@ -186,9 +186,11 @@ void Exif::setSize(const Size &size)
void Exif::setTimestamp(time_t timestamp)
{
+ struct tm tm;
+ localtime_r(&timestamp, &tm);
+
char str[20];
- std::strftime(str, sizeof(str), "%Y:%m:%d %H:%M:%S",
- std::localtime(&timestamp));
+ strftime(str, sizeof(str), "%Y:%m:%d %H:%M:%S", &tm);
std::string ts(str);
setString(EXIF_IFD_0, EXIF_TAG_DATE_TIME, EXIF_FORMAT_ASCII, ts);