Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse time zone from Nikon images #319

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

josephfrazier
Copy link
Owner

@josephfrazier josephfrazier commented Nov 28, 2021

Test Image: https://share.icloud.com/photos/0uo0pKEN5AcHE_o7d05B_pGfA#Madison_Square_Park


This is a follow-up to #317


Hmm, there's also the GPSTimeStamp field, which appears to be in GMT (14:42:45.74) and is generally close to the CreateDate time (a few minutes off), so we might be able to use it to infer the timezone.


Resources:


https://exif.online can extract the Time Zone, just need to figure out how to get JS to do it:

image


This partially addresses #318


@josephfrazier josephfrazier temporarily deployed to reported-web-nikon-exif-rs8sev November 28, 2021 00:39 Inactive
@josephfrazier josephfrazier temporarily deployed to reported-web-nikon-exif-rs8sev November 28, 2021 00:49 Inactive
@josephfrazier
Copy link
Owner Author

exiftool.js isn't working either:

image

josephfrazier added a commit that referenced this pull request Dec 8, 2021
This should help alleviate the problem that
#319 is trying to
solve. Note that it's not foolproof, due to the inherent ambiguity of
expressing times without timezones. Specifically, photos taken during
the hour that occurs twice when we switch from EDT to EST, may not have
the correct timezone applied.

Most of the code in timezone.js came from https://www.codeproject.com/articles/58728/javascript-code-to-determine-when-daylight-savings
josephfrazier added a commit that referenced this pull request Dec 8, 2021
…323)

* Guess timezone from CreateDate if OffsetTimeDigitized is not present

This should help alleviate the problem that
#319 is trying to
solve. Note that it's not foolproof, due to the inherent ambiguity of
expressing times without timezones. Specifically, photos taken during
the hour that occurs twice when we switch from EDT to EST, may not have
the correct timezone applied.

Most of the code in timezone.js came from https://www.codeproject.com/articles/58728/javascript-code-to-determine-when-daylight-savings

* Use positive offsets instead of negative

A test photo was showing up as 6:46pm rather than the correct value of
10:46am, which tipped me off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant