fix(journey): keep an iPhone photo's capture time and place through the HEIC conversion

The browser converts a HEIC to a JPEG before it uploads it, and that
JPEG carries no EXIF, so iPhone photos arrived without their capture
time and GPS. A small lazily loaded reader now takes DateTimeOriginal
with its offset and the GPS pair from the HEIC's Exif item before the
conversion, and journey photo uploads (gallery, entry, Studio) send them
as optional taken_at, lat and lng fields.

The server reads those fields leniently (an ISO instant between 1900
and tomorrow, a pair inside the globe that is not 0,0) and hands them to
the capture backfill only when the request carried one file. They fill
in only what the file's own EXIF lacks and go through the existing
COALESCE write, so a stored value is never replaced. Covers and place
images keep the plain conversion and never carry a location.
This commit is contained in:
Maurice
2026-11-30 14:38:56 +01:00
parent 555027f10f
commit 78c0f65de4
23 changed files with 931 additions and 33 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { useJourneyStore } from '../../store/journeyStore'
import { normalizeImageFiles } from '../../utils/convertHeic'
import { normalizeJourneyPhotos } from '../../utils/convertHeic'
import { isVideoFile } from '../../utils/videoPoster'
import type { UploadProgress } from '../../utils/uploadQueue'
@@ -40,7 +40,7 @@ export async function uploadStudioPhotos(
const skippedVideos = files.length - images.length
if (!images.length) return { photoIds: [], failed: 0, skippedVideos }
const normalized = await normalizeImageFiles(images)
const normalized = await normalizeJourneyPhotos(images)
const store = useJourneyStore.getState()
const sent = entryId != null
? await store.uploadPhotos(entryId, normalized, { onProgress })