diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2021-11-18 00:18:43 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2021-11-18 00:18:43 +0100 |
| commit | 74289c038e4a6a23a0b287085265205dd4bdc58e (patch) | |
| tree | fe787ceedac3d12a1342e41a424e890170a68ad0 | |
| parent | 51e8ff65dd4b777ccf90b722dc69d508cdd2497a (diff) | |
image: Add support for newer exif date time tags
| -rw-r--r-- | src/image.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image.cc b/src/image.cc index 111568c..c540387 100644 --- a/src/image.cc +++ b/src/image.cc @@ -142,6 +142,14 @@ void load_exif(std::filesystem::path const& path, ImageImpl* img) { } } entry = exif_content_get_entry(data->ifd[EXIF_IFD_0], EXIF_TAG_DATE_TIME); + if (!entry) { + entry = exif_content_get_entry(data->ifd[EXIF_IFD_EXIF], + EXIF_TAG_DATE_TIME_ORIGINAL); + if (!entry) { + entry = exif_content_get_entry(data->ifd[EXIF_IFD_EXIF], + EXIF_TAG_DATE_TIME_DIGITIZED); + } + } if (entry && entry->format == EXIF_FORMAT_ASCII) { auto date = Date::from_format("%Y:%m:%d %H:%M:%S", reinterpret_cast<char const*>(entry->data)); |
