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

fix(server): prefer explicit timezone over GPS based guess #12707

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

C-Otto
Copy link
Contributor

@C-Otto C-Otto commented Sep 15, 2024

exiftool-vendored sadly treats the offset +00:00 (used in several countries) as unknown and may return a timezone which is based on GPS coordinates. Because of this, when one manually fixes the timezone offset to +00:00, this fix is overwritten. With this fix, we explicitly prefer +00:00 (if set).

To test: Have an asset with GPS coordinates that exiftool-vendored maps to a timezone (you can check the exif database table, column timeZone). For this asset, manually change the date to use an offset of +00:00 (e.g. Atlantic/Reykjavik). The XMP files correctly includes +00:00. Without this fix, the database still contains the old (wrong?) timezone. With this fix, the timezone is UTC+0.

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides the linting issue ;)

@C-Otto
Copy link
Contributor Author

C-Otto commented Sep 15, 2024

I added // eslint-disable-next-line unicorn/prefer-ternary

@danieldietzler
Copy link
Member

I added // eslint-disable-next-line unicorn/prefer-ternary

Why not use a ternary?

exiftool-vendored sadly treats the offset +00:00 (used in several countries) as unknown
and may return a timezone which is based on GPS coordinates. Because of this, when
one manually fixes the timezone offset to +00:00, this fix is overwritten. With this fix,
we explicitly prefer +00:00 (if set).
@C-Otto
Copy link
Contributor Author

C-Otto commented Sep 15, 2024

Why not use a ternary?

Good question. I'm not used to it, but it doesn't look too bad.

@jrasm91
Copy link
Contributor

jrasm91 commented Sep 18, 2024

Why would the gps timezone ever be wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants