Metadata: Add DateTimeDigitized as fallback value for TakenAt #304
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
03f3b802fc
commit
ba524d05d6
2 changed files with 4 additions and 2 deletions
|
@ -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"`
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue