mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
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:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user