diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2017-05-07 15:21:39 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2017-05-07 15:21:39 +0200 |
| commit | 29381f9e70d122ea4d89d71ea97f42253c528211 (patch) | |
| tree | 14c947844ea4402658bdfdf7e7b4810ed781fd81 /src/jpeg-utils.cpp | |
| parent | db3d992febbe703931840e9bdad95c43081694a5 (diff) | |
| download | cataract-29381f9e70d122ea4d89d71ea97f42253c528211.tar.xz | |
jpeg-utils: Allow custom datetime format
The default locale datetime format string may not suit everyone, this
adds possibility to specify custom format. The format string should be
syntactically conforming to strftime(3).
Diffstat (limited to 'src/jpeg-utils.cpp')
| -rw-r--r-- | src/jpeg-utils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jpeg-utils.cpp b/src/jpeg-utils.cpp index e9e1e65..61aeebd 100644 --- a/src/jpeg-utils.cpp +++ b/src/jpeg-utils.cpp @@ -289,7 +289,7 @@ get_exif_data_fixed (ExifData *exif, const gchar *key) if (exif->override_datetime != (time_t) -1) { tt = (struct tm *) g_malloc0 (sizeof (struct tm)); localtime_r (&exif->override_datetime, tt); - if (strftime (&conv[0], sizeof (conv), "%c", tt)) + if (strftime (&conv[0], sizeof (conv), exif->datetime_format ? exif->datetime_format : "%c", tt)) res = g_strdup (&conv[0]); } @@ -297,7 +297,7 @@ get_exif_data_fixed (ExifData *exif, const gchar *key) tt = parse_exif_date (val); if (tt) { shift_time (tt, exif->timezone_shift); - if (strftime (&conv[0], sizeof (conv), "%c", tt)) + if (strftime (&conv[0], sizeof (conv), exif->datetime_format ? exif->datetime_format : "%c", tt)) res = g_strdup (&conv[0]); } } |
