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",
|
"favicons",
|
||||||
"favs",
|
"favs",
|
||||||
"ghijklmnopqrstuv",
|
"ghijklmnopqrstuv",
|
||||||
|
"GPSH",
|
||||||
"Hasselblad",
|
"Hasselblad",
|
||||||
"headlessui",
|
"headlessui",
|
||||||
"hgetall",
|
"hgetall",
|
||||||
|
|||||||
@ -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',
|
||||||
|
|||||||
@ -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}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -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));
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user