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",
"favs",
"ghijklmnopqrstuv",
"GPSH",
"Hasselblad",
"headlessui",
"hgetall",

View File

@ -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',

View File

@ -8,7 +8,7 @@ export interface MoreMenuItem {
label: ReactNode
icon?: ReactNode
href?: string
hrefTargetBlank?: boolean
hrefDownloadName?: string
action?: () => Promise<void> | 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 }) =>
<MoreMenuItem
key={`${label}`}
label={label}
icon={icon}
href={href}
hrefTargetBlank={hrefTargetBlank}
hrefDownloadName={hrefDownloadName}
action={action}
/>
)}

View File

@ -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> | 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));

View File

@ -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();