mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use DateTimeOriginal on image import
Some digital cameras do not set the DateTime exif field bat use DateTimeOriginal. If the first option is not found, use the second one to try to detect the moment when the image was shot. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1328b44d44
commit
28454889d9
1 changed files with 4 additions and 1 deletions
|
@ -209,7 +209,10 @@ time_t ShiftImageTimesDialog::epochFromExiv(EXIFInfo *exif)
|
|||
struct tm tm;
|
||||
int year, month, day, hour, min, sec;
|
||||
|
||||
sscanf(exif->DateTime.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec);
|
||||
if (strlen(exif->DateTime.c_str()))
|
||||
sscanf(exif->DateTime.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec);
|
||||
else
|
||||
sscanf(exif->DateTimeOriginal.c_str(), "%d:%d:%d %d:%d:%d", &year, &month, &day, &hour, &min, &sec);
|
||||
tm.tm_year = year;
|
||||
tm.tm_mon = month - 1;
|
||||
tm.tm_mday = day;
|
||||
|
|
Loading…
Add table
Reference in a new issue