Metadata: Add DateTimeDigitized as fallback value for TakenAt #304

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-16 09:27:21 +02:00
parent 03f3b802fc
commit ba524d05d6
2 changed files with 4 additions and 2 deletions

View file

@ -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"`

View file

@ -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) {