fix(gps): stop stamping the phone's current location on a picked photo
The library flow ended in a device-GPS fallback: whenever a photo's own coordinates could not be read, getCurrentGPS() supplied the phone's present spot, so the mark named wherever the user was standing instead of where the photo was taken. Drop that tier entirely -- a photo with no readable location gets no GPS mark. Also keep the legacy Android picker unconditionally so the picked file keeps its EXIF GPS whatever the chip state, and prefer the city over subAdminArea (county/district) as the displayed place name.
This commit is contained in:
@@ -49,13 +49,12 @@ export async function getCurrentGPS(): Promise<GPSInfo | null> {
|
||||
}
|
||||
}
|
||||
|
||||
// The one place-name picker. Order is the camera's original one
|
||||
// (subregion = subAdminArea = district/county first, then city, district,
|
||||
// region) kept verbatim so already-working camera stamps do not shift; only
|
||||
// the photo path used to drop the district term. Shared so the camera stamp
|
||||
// and a photo's stamp can never disagree about the same coordinates.
|
||||
// The one place-name picker: city first, because "the place" on a stamp means
|
||||
// the town people would name, while subregion is Android's subAdminArea — the
|
||||
// county/district, i.e. the wrong name for the same coordinates. Shared so the
|
||||
// camera stamp and a photo's stamp can never disagree.
|
||||
export function localityName(address: Location.LocationGeocodedAddress): string | null {
|
||||
const name = address.subregion || address.city || address.district || address.region;
|
||||
const name = address.city || address.subregion || address.district || address.region;
|
||||
return name ? name.toUpperCase() : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user