From ba524d05d606ea35a98a1efcb439213e2a2add49 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sat, 16 May 2020 09:27:21 +0200 Subject: [PATCH] Metadata: Add DateTimeDigitized as fallback value for TakenAt #304 Signed-off-by: Michael Mayer --- internal/meta/data.go | 4 ++-- internal/meta/exif.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/meta/data.go b/internal/meta/data.go index cf51ab1b1..2de2da15f 100644 --- a/internal/meta/data.go +++ b/internal/meta/data.go @@ -8,8 +8,8 @@ import ( // Data represents image meta data. type Data struct { UniqueID string `meta:"ImageUniqueID"` - TakenAt time.Time `meta:"DateTimeOriginal,CreateDate,MediaCreateDate,DateTime"` - TakenAtLocal time.Time `meta:"DateTimeOriginal,CreateDate,MediaCreateDate,DateTime"` + TakenAt time.Time `meta:"DateTimeOriginal,CreateDate,MediaCreateDate,DateTimeDigitized,DateTime"` + TakenAtLocal time.Time `meta:"DateTimeOriginal,CreateDate,MediaCreateDate,DateTimeDigitized,DateTime"` TimeZone string `meta:"-"` Duration time.Duration `meta:"Duration,MediaDuration,TrackDuration"` Codec string `meta:"CompressorID,Compression"` diff --git a/internal/meta/exif.go b/internal/meta/exif.go index 2ad34f553..d9695f323 100644 --- a/internal/meta/exif.go +++ b/internal/meta/exif.go @@ -315,6 +315,8 @@ func (data *Data) Exif(fileName string) (err error) { if value, ok := tags["DateTimeOriginal"]; ok && ValidDateTime(value) { takenAt = value + } else if value, ok := tags["DateTimeDigitized"]; ok && ValidDateTime(value) { + takenAt = value } else if value, ok := tags["CreateDate"]; ok && ValidDateTime(value) { takenAt = value } else if value, ok := tags["DateTime"]; ok && ValidDateTime(value) {