Skip to content

Commit

Permalink
Add TODO for improving time offset handling in EXIF metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
simulot committed Nov 1, 2024
1 parent 7d5a74e commit 5e03ecc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions internal/metadata/exiftool.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ var dateKeys = []struct {

// GetMetadata returns the metadata of the file. The date of capture is searched in the preferred tags first.
// missing tags or tags with incorrect dates are skipped
//
// TODO: make a better use of time offset taken on the exif fields
// ```
// Modify Date : 2023:10:06 08:30:00
// Date/Time Original : 2023:10:06 08:30:00
// Create Date : 2023:10:06 08:30:00
// Offset Time : +02:00
// Offset Time Original : +02:00
// Offset Time Digitized : +02:00
// Sub Sec Time : 139
// Sub Sec Time Original : 139
// Sub Sec Time Digitized : 139
// GPS Time Stamp : 06:29:56
// GPS Date Stamp : 2023:10:06
// Profile Date Time : 2023:03:09 10:57:00
// Create Date : 2023:10:06 08:30:00.139+02:00
// Date/Time Original : 2023:10:06 08:30:00.139+02:00
// Modify Date : 2023:10:06 08:30:00.139+02:00
// GPS Date/Time : 2023:10:06 06:29:56Z
// ```

func (et *ExifTool) ReadMetaData(fileName string) (*Metadata, error) {
ms := et.eTool.ExtractMetadata(fileName)
Expand Down
2 changes: 1 addition & 1 deletion internal/metadata/exiftool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestExifTool_ReadMetaData(t *testing.T) {
name: "read JPG",
fileName: "DATA/PXL_20231006_063000139.jpg",
want: &Metadata{
DateTaken: time.Date(2023, 10, 6, 8, 30, 0, 0, time.Local),
DateTaken: time.Date(2023, 10, 6, 6, 29, 56, 0, time.UTC), // 2023:10:06 06:29:56Z
Latitude: +48.8583736,
Longitude: +2.2919010,
},
Expand Down

0 comments on commit 5e03ecc

Please sign in to comment.