diff --git a/apps/api/src/autopilot/service.ts b/apps/api/src/autopilot/service.ts index 90be1a8..6386edb 100644 --- a/apps/api/src/autopilot/service.ts +++ b/apps/api/src/autopilot/service.ts @@ -211,7 +211,7 @@ export class AutopilotService { cropBias: style?.cropBias ?? null, sport: photo.event?.sport ?? null, lens: lensHintFromExif(photo.exif, photo.focalLength, photo.lens), - edgeClutter, + ...(edgeClutter ? { edgeClutter } : {}), settings, }); const ops = planned.ops; diff --git a/apps/api/src/ingest/exif.ts b/apps/api/src/ingest/exif.ts index 4fe1c18..3402371 100644 --- a/apps/api/src/ingest/exif.ts +++ b/apps/api/src/ingest/exif.ts @@ -188,7 +188,8 @@ function extraOf(tags: Record): CameraExtra { const lat = num(tags.latitude); const lon = num(tags.longitude); const alt = num(tags.GPSAltitude); - const extra: CameraExtra = { + // Build then drop undefined keys — exactOptionalPropertyTypes forbids `rollAngle?: number | undefined`. + const draft = { exposureCompensation: num(tags.ExposureCompensation) ?? num(tags.ExposureBiasValue), flashFired: flash === undefined ? undefined : (flash & 1) === 1, meteringMode: metering === undefined ? undefined : (METERING[metering] ?? (metering === 255 ? "Other" : undefined)), @@ -211,7 +212,7 @@ function extraOf(tags: Record): CameraExtra { longitude: lon, altitude: alt === undefined ? undefined : num(tags.GPSAltitudeRef) === 1 ? -alt : alt, }; - return Object.fromEntries(Object.entries(extra).filter(([, v]) => v !== undefined)) as CameraExtra; + return Object.fromEntries(Object.entries(draft).filter(([, v]) => v !== undefined)) as CameraExtra; } /** The focus point in a file (the original, which still has the camera's EXIF). Null when the body wrote none. */