Tweak GPS overwrite schema

This commit is contained in:
Sam Becker 2024-06-08 17:39:27 -05:00
parent cdf70fa5c7
commit b8e1d22b64
5 changed files with 18 additions and 15 deletions

View File

@ -18,6 +18,7 @@
"favicons", "favicons",
"favs", "favs",
"ghijklmnopqrstuv", "ghijklmnopqrstuv",
"GPSH",
"Hasselblad", "Hasselblad",
"headlessui", "headlessui",
"hgetall", "hgetall",

View File

@ -63,7 +63,7 @@ export default function AdminPhotoMenuClient({
className="translate-x-[-1.5px] translate-y-[-0.5px]" className="translate-x-[-1.5px] translate-y-[-0.5px]"
/>, />,
href: photo.url, href: photo.url,
hrefTargetBlank: true, hrefDownloadName: photo.url.split('/').pop(),
}); });
items.push({ items.push({
label: 'Delete', label: 'Delete',

View File

@ -8,7 +8,7 @@ export interface MoreMenuItem {
label: ReactNode label: ReactNode
icon?: ReactNode icon?: ReactNode
href?: string href?: string
hrefTargetBlank?: boolean hrefDownloadName?: string
action?: () => Promise<void> | void action?: () => Promise<void> | void
} }
@ -52,13 +52,13 @@ export default function MoreMenu({
'shadow-lg dark:shadow-xl', 'shadow-lg dark:shadow-xl',
)} )}
> >
{items.map(({ label, icon, href, hrefTargetBlank, action }) => {items.map(({ label, icon, href, hrefDownloadName, action }) =>
<MoreMenuItem <MoreMenuItem
key={`${label}`} key={`${label}`}
label={label} label={label}
icon={icon} icon={icon}
href={href} href={href}
hrefTargetBlank={hrefTargetBlank} hrefDownloadName={hrefDownloadName}
action={action} action={action}
/> />
)} )}

View File

@ -10,13 +10,13 @@ export default function MoreMenuItem({
label, label,
icon, icon,
href, href,
hrefTargetBlank, hrefDownloadName,
action, action,
}: { }: {
label: ReactNode label: ReactNode
icon?: ReactNode icon?: ReactNode
href?: string href?: string
hrefTargetBlank?: boolean hrefDownloadName?: string
action?: () => Promise<void> | void action?: () => Promise<void> | void
}) { }) {
const router = useRouter(); const router = useRouter();
@ -41,7 +41,7 @@ export default function MoreMenuItem({
onClick={e => { onClick={e => {
e.preventDefault(); e.preventDefault();
if (href) { if (href) {
if (hrefTargetBlank) { if (Boolean(hrefDownloadName)) {
window.open(href, '_blank'); window.open(href, '_blank');
} else { } else {
startTransition(() => router.push(href)); startTransition(() => router.push(href));

View File

@ -143,20 +143,22 @@ export const removeGpsData = async (image: ArrayBuffer) =>
.withExifMerge({ .withExifMerge({
IFD3: { IFD3: {
GPSMapDatum: GPS_NULL_STRING, GPSMapDatum: GPS_NULL_STRING,
GPSLatitudeRef: GPS_NULL_STRING,
GPSLatitude: GPS_NULL_STRING, GPSLatitude: GPS_NULL_STRING,
GPSLongitudeRef: GPS_NULL_STRING,
GPSLongitude: GPS_NULL_STRING, GPSLongitude: GPS_NULL_STRING,
GPSDateStamp: GPS_NULL_STRING,
GPSDateTime: GPS_NULL_STRING,
GPSTimeStamp: GPS_NULL_STRING, GPSTimeStamp: GPS_NULL_STRING,
GPSAltitude: GPS_NULL_STRING, GPSAltitude: GPS_NULL_STRING,
GPSAltitudeRef: GPS_NULL_STRING,
GPSSatellites: 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, 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(); .toBuffer();