From 53d814e62e954e091c6f6645a5284005fadb6bf4 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 17 May 2022 02:03:50 +0200 Subject: [PATCH] Metadata: Prefer SubSecDateTimeOriginal and SubSecCreateDate #2320 --- internal/meta/data.go | 4 ++-- internal/meta/json_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/meta/data.go b/internal/meta/data.go index 38c189ce7..77037f9e9 100644 --- a/internal/meta/data.go +++ b/internal/meta/data.go @@ -17,8 +17,8 @@ type Data struct { FileName string `meta:"FileName"` DocumentID string `meta:"BurstUUID,MediaGroupUUID,ImageUniqueID,OriginalDocumentID,DocumentID"` InstanceID string `meta:"InstanceID,DocumentID"` - TakenAt time.Time `meta:"DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime,SubSecDateTimeOriginal,SubSecCreateDate" xmp:"DateCreated"` - TakenAtLocal time.Time `meta:"DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime,SubSecDateTimeOriginal,SubSecCreateDate"` + TakenAt time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime" xmp:"DateCreated"` + TakenAtLocal time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime"` TakenGps time.Time `meta:"GPSDateTime,GPSDateStamp"` TakenNs int `meta:"-"` TimeZone string `meta:"-"` diff --git a/internal/meta/json_test.go b/internal/meta/json_test.go index 06264b8c1..9a4e02fcd 100644 --- a/internal/meta/json_test.go +++ b/internal/meta/json_test.go @@ -687,8 +687,8 @@ func TestJSON(t *testing.T) { assert.Equal(t, CodecJpeg, data.Codec) assert.Equal(t, "0s", data.Duration.String()) - assert.Equal(t, "2016-09-07 12:49:23 +0000 UTC", data.TakenAtLocal.String()) - assert.Equal(t, "2016-09-07 12:49:23 +0000 UTC", data.TakenAt.String()) + assert.Equal(t, "2016-09-07 12:49:23.373 +0000 UTC", data.TakenAtLocal.String()) + assert.Equal(t, "2016-09-07 12:49:23.373 +0000 UTC", data.TakenAt.String()) assert.Equal(t, 373000000, data.TakenNs) assert.Equal(t, "", data.TimeZone) assert.Equal(t, 4032, data.Width) @@ -714,8 +714,8 @@ func TestJSON(t *testing.T) { assert.Equal(t, CodecJpeg, data.Codec) assert.Equal(t, "0s", data.Duration.String()) - assert.Equal(t, "2016-09-07 12:49:23 +0000 UTC", data.TakenAtLocal.String()) - assert.Equal(t, "2016-09-07 12:49:23 +0000 UTC", data.TakenAt.String()) + assert.Equal(t, "2016-09-07 12:49:23.373 +0000 UTC", data.TakenAtLocal.String()) + assert.Equal(t, "2016-09-07 12:49:23.373 +0000 UTC", data.TakenAt.String()) assert.Equal(t, "", data.TimeZone) assert.Equal(t, 4032, data.Width) assert.Equal(t, 3024, data.Height)