Search for DateTimeOriginal if not found in standard location

The DateTimeOriginal and DateTimeDigitized Exif tags should be in the
same group - ExifIFD, but the Leica M8 stores DateTimeOriginal in the
IFD0 group. This patch by Flössie allows to find the tag.
Closes #5251
This commit is contained in:
Morgan Hardwood 2019-03-29 09:21:47 +01:00
parent 68ba87a71f
commit e23fc17ccf

View File

@ -260,7 +260,7 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
iso_speed = tag->toDouble (); iso_speed = tag->toDouble ();
} }
if ((tag = exif->getTag ("DateTimeOriginal"))) { if ((tag = exif->findTag("DateTimeOriginal", true))) {
if (sscanf ((const char*)tag->getValue(), "%d:%d:%d %d:%d:%d", &time.tm_year, &time.tm_mon, &time.tm_mday, &time.tm_hour, &time.tm_min, &time.tm_sec) == 6) { if (sscanf ((const char*)tag->getValue(), "%d:%d:%d %d:%d:%d", &time.tm_year, &time.tm_mon, &time.tm_mday, &time.tm_hour, &time.tm_min, &time.tm_sec) == 6) {
time.tm_year -= 1900; time.tm_year -= 1900;
time.tm_mon -= 1; time.tm_mon -= 1;