Tweak GPS overwrite schema
This commit is contained in:
parent
cdf70fa5c7
commit
b8e1d22b64
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -18,6 +18,7 @@
|
||||
"favicons",
|
||||
"favs",
|
||||
"ghijklmnopqrstuv",
|
||||
"GPSH",
|
||||
"Hasselblad",
|
||||
"headlessui",
|
||||
"hgetall",
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user