photostructure / exiftool-vendored.js

Fast, cross-platform Node.js access to ExifTool
https://photostructure.github.io/exiftool-vendored.js/
MIT License
405 stars 37 forks source link

Infer timezone information for Sony A7 first gen #187

Open fwsmit opened 3 weeks ago

fwsmit commented 3 weeks ago

Is your feature request related to a problem? Please describe. The metadata of pictures taken with the Sony A7 first gen (and presumably other sony camera's) doesn't include straight up timezone information. The current method for inferring the timezone information is not sufficient for this camera.

Describe the solution you'd like The timezone offset can be inferred from the "Sony Date Time 2" field, which seems to be the time in UTC. I would suggest to add this field as an additional source of UTC timestamps. Maybe it should only be done if a sony camera is detected.

Describe alternatives you've considered This seems to be the only clue of timezone information, as the camera doesn't have GPS.

Additional context Below are some examples of pictures taken with different timezones. They all have the same of 20:10 UTC. Note that this is reflected in the "Sony date time 2" variable.

GMT +0 (no daylight savings)

> exiftool DSC00341.JPG  | grep -i date
File Modification Date/Time     : 2024:06:11 20:10:06+02:00
File Access Date/Time           : 2024:06:11 22:47:15+02:00
File Inode Change Date/Time     : 2024:06:11 22:47:14+02:00
Modify Date                     : 2024:06:11 20:10:07
Date/Time Original              : 2024:06:11 20:10:07
Create Date                     : 2024:06:11 20:10:07
Sony Date Time                  : 2024:06:11 20:10:07
Sony Date Time 2                : 2024:06:11 20:10:07

GMT+0 (daylight savings time)

> exiftool DSC00336.JPG  | grep -i date
File Modification Date/Time     : 2024:06:11 21:10:34+02:00
File Access Date/Time           : 2024:06:11 22:14:58+02:00
File Inode Change Date/Time     : 2024:06:11 22:14:58+02:00
Modify Date                     : 2024:06:11 21:10:34
Date/Time Original              : 2024:06:11 21:10:34
Create Date                     : 2024:06:11 21:10:34
Sony Date Time                  : 2024:06:11 21:10:34
Sony Date Time 2                : 2024:06:11 20:10:34

GMT +1 (daylight savings time)

> exiftool DSC00337.JPG  | grep -i date
File Modification Date/Time     : 2024:06:11 22:10:48+02:00
File Access Date/Time           : 2024:06:11 22:14:58+02:00
File Inode Change Date/Time     : 2024:06:11 22:14:58+02:00
Modify Date                     : 2024:06:11 22:10:49
Date/Time Original              : 2024:06:11 22:10:49
Create Date                     : 2024:06:11 22:10:49
Sony Date Time                  : 2024:06:11 22:10:49
Sony Date Time 2                : 2024:06:11 20:10:49

GMT +5.5 (daylight savings time)

exiftool DSC00339.JPG  | grep -i date
File Modification Date/Time     : 2024:06:12 02:40:04+02:00
File Access Date/Time           : 2024:06:11 22:38:53+02:00
File Inode Change Date/Time     : 2024:06:11 22:14:58+02:00
Modify Date                     : 2024:06:12 02:40:04
Date/Time Original              : 2024:06:12 02:40:04
Create Date                     : 2024:06:12 02:40:04
Sony Date Time                  : 2024:06:12 02:40:04
Sony Date Time 2                : 2024:06:11 20:10:04
mceachen commented 3 weeks ago

Thanks for taking the time to open this issue.

If you want to provide a PR with tests, example images, and a strict include-list for those Sony mirrorless that we can show behave in this fashion, I'll review it.

fwsmit commented 3 weeks ago

Cool, I'll work on that. For now I only know about this for my camera. I'll see if I can get more example images from other cameras.

fwsmit commented 3 weeks ago

I've asked for some example pictures to be submitted in this issue.

I'm working on resolving the issues with timezone detection for DSLR pictures. At least on my Sony A7 first gen it's possible to infer the timezone from the exif metadata. To fix this issue for other camera's as well, I need some example pictures.

To submit example pictures, please follow the following steps:

  • Set your camera to a time of 10:00 AM and a timezone of GMT+0 (No daylight savings time). Take the first picture.
  • Set your camera to a timezone of GMT+8 (No daylight savings time). The time should now be 18:00. Take the second picture

Upload both pictures to the following github issue: https://github.com/photostructure/exiftool-vendored.js/issues/187. Please document clearly which image is which timezone and which camera you used.

DeltaTango69 commented 3 weeks ago

The problem is that on my camera SONY DSC-RX 100 no timezone information is available. Therefore example photos make no sence. All times on first photo are 10:00 AM the second are 18:00PM !

fwsmit commented 3 weeks ago

The problem is that on my camera SONY DSC-RX 100 no timezone information is available. Therefore example photos make no sence. All times on first photo are 10:00 AM the second are 18:00PM !

Does your camera have an option to set the timezone in the settings? If so, there might be timezone information hidden in the metadata. If not and it also doesn't have a GPS, then there is no way to tell yeah.

DeltaTango69 commented 3 weeks ago

Yes there is an option to set it - but this information is not stored anywhere. The camera has also no gps!

fwsmit commented 3 weeks ago

Are you sure it's not stored anywhere? If you send the pictures to me, I can double check it for you. It may be hidden somewhere, like it is in my camera

DeltaTango69 commented 3 weeks ago

Here are both photos, dates are on the pictures. DSC09717.zip

DeltaTango69 commented 3 weeks ago

Good look - I have used exiftoolgui - but nothing found in the metadata

fwsmit commented 3 weeks ago

Good look - I have used exiftoolgui - but nothing found in the metadata

I also cannot find anything useful in the metadata unfortunately :(