fix: legacy picker for real photo GPS on Android 13+, watermark shows place + capture datetime

This commit is contained in:
2026-09-08 11:28:02 +07:00
parent 7d77be5029
commit 43a73c541b
3 changed files with 18 additions and 32 deletions
+5 -16
View File
@@ -24,7 +24,6 @@ import { Lock } from 'lucide-react-native';
import { Recipe, GPSInfo, FrameId } from '../types';
import { getSkiaColorMatrix, applyExposureGain } from '../utils/colorUtils';
import { TONE_SKSL, getToneUniforms } from '../utils/toneShader';
import { formatCoordinate } from '../utils/locationUtils';
interface ViewfinderProps {
mode: 'camera' | 'library';
@@ -481,19 +480,10 @@ export default function Viewfinder({
const renderGPSWatermark = () => {
if (!useGeotag || !gpsInfo || !customFont) return null;
const latStr = formatCoordinate(gpsInfo.latitude, 'lat');
const lonStr = formatCoordinate(gpsInfo.longitude, 'lon');
const locationName = gpsInfo.locality || 'STREET VIEW';
const timestampStr = new Date(gpsInfo.timestamp).toLocaleDateString('vi-VN');
const sourceTag =
gpsInfo.source === 'exif'
? 'EXIF'
: gpsInfo.source === 'mediaLibrary'
? 'MEDIA LIB'
: gpsInfo.source === 'device'
? 'DEVICE GPS'
: null;
const captionSuffix = sourceTag ? ` | ${sourceTag}` : ' | SS 1/125 f/2.8';
const d = new Date(gpsInfo.timestamp);
const pad = (n: number) => String(n).padStart(2, '0');
const timestampStr = `${pad(d.getDate())}/${pad(d.getMonth() + 1)}/${d.getFullYear()} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
// Baseline above the bottom chrome (shutter rail) so the watermark stays
// readable; polaroid frames push it further up onto the white area edge.
@@ -502,9 +492,8 @@ export default function Viewfinder({
return (
<Group>
<SkiaText x={xOffset} y={yOffset - 32} text={`📍 ${locationName}`} font={customFont} color="#f59e0b" />
<SkiaText x={xOffset} y={yOffset - 16} text={`${latStr}, ${lonStr}`} font={customFont} color="#f59e0b" />
<SkiaText x={xOffset} y={yOffset} text={`${timestampStr}${captionSuffix}`} font={customFont} color="#f59e0b" />
<SkiaText x={xOffset} y={yOffset - 16} text={`📍 ${locationName}`} font={customFont} color="#f59e0b" />
<SkiaText x={xOffset} y={yOffset} text={timestampStr} font={customFont} color="#f59e0b" />
</Group>
);
};