From b8e1d22b64c70a4e3f1d17c2413873011c3801b9 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sat, 8 Jun 2024 17:39:27 -0500 Subject: [PATCH] Tweak GPS overwrite schema --- .vscode/settings.json | 1 + src/admin/AdminPhotoMenuClient.tsx | 2 +- src/components/more/MoreMenu.tsx | 6 +++--- src/components/more/MoreMenuItem.tsx | 6 +++--- src/photo/server.ts | 18 ++++++++++-------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index bb3ac392..057dda2f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,6 +18,7 @@ "favicons", "favs", "ghijklmnopqrstuv", + "GPSH", "Hasselblad", "headlessui", "hgetall", diff --git a/src/admin/AdminPhotoMenuClient.tsx b/src/admin/AdminPhotoMenuClient.tsx index 892ae04e..9665a8e8 100644 --- a/src/admin/AdminPhotoMenuClient.tsx +++ b/src/admin/AdminPhotoMenuClient.tsx @@ -63,7 +63,7 @@ export default function AdminPhotoMenuClient({ className="translate-x-[-1.5px] translate-y-[-0.5px]" />, href: photo.url, - hrefTargetBlank: true, + hrefDownloadName: photo.url.split('/').pop(), }); items.push({ label: 'Delete', diff --git a/src/components/more/MoreMenu.tsx b/src/components/more/MoreMenu.tsx index 7b8e493d..4c646b43 100644 --- a/src/components/more/MoreMenu.tsx +++ b/src/components/more/MoreMenu.tsx @@ -8,7 +8,7 @@ export interface MoreMenuItem { label: ReactNode icon?: ReactNode href?: string - hrefTargetBlank?: boolean + hrefDownloadName?: string action?: () => Promise | void } @@ -52,13 +52,13 @@ export default function MoreMenu({ 'shadow-lg dark:shadow-xl', )} > - {items.map(({ label, icon, href, hrefTargetBlank, action }) => + {items.map(({ label, icon, href, hrefDownloadName, action }) => )} diff --git a/src/components/more/MoreMenuItem.tsx b/src/components/more/MoreMenuItem.tsx index 8b7ccc2d..213f1601 100644 --- a/src/components/more/MoreMenuItem.tsx +++ b/src/components/more/MoreMenuItem.tsx @@ -10,13 +10,13 @@ export default function MoreMenuItem({ label, icon, href, - hrefTargetBlank, + hrefDownloadName, action, }: { label: ReactNode icon?: ReactNode href?: string - hrefTargetBlank?: boolean + hrefDownloadName?: string action?: () => Promise | void }) { const router = useRouter(); @@ -41,7 +41,7 @@ export default function MoreMenuItem({ onClick={e => { e.preventDefault(); if (href) { - if (hrefTargetBlank) { + if (Boolean(hrefDownloadName)) { window.open(href, '_blank'); } else { startTransition(() => router.push(href)); diff --git a/src/photo/server.ts b/src/photo/server.ts index 946374e7..b01a70e2 100644 --- a/src/photo/server.ts +++ b/src/photo/server.ts @@ -143,20 +143,22 @@ export const removeGpsData = async (image: ArrayBuffer) => .withExifMerge({ IFD3: { GPSMapDatum: GPS_NULL_STRING, - GPSLatitudeRef: GPS_NULL_STRING, GPSLatitude: GPS_NULL_STRING, - GPSLongitudeRef: GPS_NULL_STRING, GPSLongitude: GPS_NULL_STRING, + GPSDateStamp: GPS_NULL_STRING, + GPSDateTime: GPS_NULL_STRING, GPSTimeStamp: GPS_NULL_STRING, GPSAltitude: GPS_NULL_STRING, - GPSAltitudeRef: GPS_NULL_STRING, GPSSatellites: GPS_NULL_STRING, - GPSDestLatitude: GPS_NULL_STRING, - GPSDestLongitudeRef: GPS_NULL_STRING, - GPSDestDistance: GPS_NULL_STRING, - GPSDestDistanceRef: GPS_NULL_STRING, GPSAreaInformation: GPS_NULL_STRING, + GPSSpeed: GPS_NULL_STRING, + GPSImgDirection: GPS_NULL_STRING, + GPSDestLatitude: GPS_NULL_STRING, + GPSDestLongitude: GPS_NULL_STRING, + GPSDestBearing: GPS_NULL_STRING, + GPSDestDistance: GPS_NULL_STRING, + GPSHPositioningError: GPS_NULL_STRING, }, }) - .toFormat('jpeg', { quality: PRO_MODE_ENABLED ? 100 : 80 }) + .toFormat('jpeg', { quality: PRO_MODE_ENABLED ? 95 : 80 }) .toBuffer();