fix: preserve EXIF timezone offset in JPEG export#1246
Open
marceldenzer wants to merge 1 commit into
Open
Conversation
- combine_datetime_with_offset: write offset inline into DateTimeOriginal and CreateDate (e.g. 2026:06:05 11:33:26+02:00) per EXIF 2.31 spec - parse_offset_secs: strip surrounding quotes from offset string returned by kamadak-exif to prevent format errors - get_creation_date_from_path: correctly convert local datetime to UTC before setting file mtime, fixing +2h offset on exported JPEGs - Rawler fallback: read offset directly from RAW file when sidecar does not contain OffsetTime (backwards compatibility for old sidecars) Fixes: File Modification Date/Time showing +2h on export Fixes: DateTimeOriginal written without inline timezone offset Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DateTimeOriginalwas written without inline timezone offset (e.g.2026-06-05 11:33:26instead of2026:06:05 11:33:26+02:00), causing Apple Photos and other viewers to misinterpret the time as UTCget_creation_date_from_pathtreated local camera time as UTC before callingset_file_timesOffsetTime,OffsetTimeOriginal, andOffsetTimeDigitizedtags for maximum compatibilityChanges in
src-tauri/src/exif_processing.rscombine_datetime_with_offset: new helper that normalises the date separator (dashes → colons) and appends the timezone offset inline per EXIF 2.31 specparse_offset_secs: new helper that converts+HH:MM/-HH:MMstrings to seconds east of UTC; strips surrounding quotes fromkamadak-exifdisplay_value()output to prevent silent parse failuresget_creation_date_from_path(sidecar branch): readsOffsetTimeOriginal/OffsetTimefrom the sidecar map and subtracts the offset before constructingDateTime<Utc>; falls back to reading the offset directly from the RAW file viarawlerwhen the sidecar predates OffsetTime supportget_creation_date_from_path(rawler branch): same UTC conversion appliedwrite_image_with_metadata(all three branches — sidecar map, kamadak-exif, rawler):DateTimeOriginalandCreateDatenow include the inline offset; all three OffsetTime* tags are writtenTest plan
DateTimeOriginalin exported JPEG contains inline offset (e.g.2026:06:05 11:33:26+02:00)OffsetTimeOriginal/OffsetTime/OffsetTimeDigitizedtags are presentOffsetTimekey) to confirm rawler fallback works🤖 Generated with Claude Code