Add camera clock correction to photo imports - #14
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughCamera EXIF parsing now records timezone provenance and supports camera clock correction. Upload analysis applies and reapplies corrections before placement, while ChangesCamera clock correction
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant UploadPhotoPanel
participant EXIF
participant PlacementWorkspace
participant PlacementQueue
UploadPhotoPanel->>EXIF: Extract and correct photo timestamps
UploadPhotoPanel->>PlacementQueue: Run automatic placement
UploadPhotoPanel->>PlacementWorkspace: Pass correction state and callback
PlacementWorkspace->>UploadPhotoPanel: Submit selected hour offset
UploadPhotoPanel->>EXIF: Recalculate corrected timestamps
UploadPhotoPanel->>PlacementQueue: Recompute automatic placement
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Pad seconds-less datetimes before building the ISO string so an explicit offset is not silently discarded as an invalid Date - Honor a zone designator trailing the datetime value itself (video creation times like ...T14:30:00Z) instead of reinterpreting the instant as trip-local wall clock and leaving it user-shiftable - Accept colon-less offsets (+0200) from cameras - Derive timeZoneSource in parseExifDate rather than re-matching the offset tag in extractPhotoExif, which mislabeled fallback parses - Restore the camera clock correction select state when restoring a draft whose items already carry a correction
Summary
OffsetTimeOriginalWhy
Digital cameras commonly store a local wall-clock capture time without a timezone. The importer previously parsed that value in the uploader's browser timezone, so photos taken at the same moment could appear hours apart from iPhone photos. Some cameras also have an incorrectly set clock, which requires an explicit batch adjustment even after applying the trip timezone.
The new control is intentionally scoped only to items without embedded timezone metadata. Mixed iPhone/camera batches therefore preserve authoritative iPhone instants while allowing camera timestamps to be shifted by a whole-hour offset with an immediate preview in the import queue.
Changing the correction replaces the prior value rather than compounding it. If the adjusted timestamp crosses midnight, day matching is recalculated. Time- and route-inferred positions are rebuilt from the corrected timestamp; EXIF GPS and user-placed pins remain unchanged.
Validation
npm run ci— 207 tests passed; typecheck passed; lint passed with one pre-existinguseMembership.tswarningnpm run build— production build passednpm run test:e2e— 7 Playwright tests passed across desktop and mobilegit diff --checkScope note
The previously approved one-off production correction for the existing 40-camera-photo batch was performed separately. This PR contains no data migration and does not repeat that update.
Summary by CodeRabbit
New Features
Bug Fixes