feat: add exif data to image tags
All checks were successful
Deploy to SFTP Server / build (push) Successful in 5m16s

This commit is contained in:
max_richter 2024-06-21 16:26:23 +02:00
parent f55ae8a267
commit 6f433e08ce

View File

@ -47,6 +47,7 @@ const allowedExif = [
export async function getExifData(image: ImageMetadata) {
const sharp = await getSharp();
if (!sharp) return;
try {
const tags = await ExifReader.load((image as ImageMetadata & { fsPath: string }).fsPath, { async: true });
const out: Record<string, any> = {};
@ -59,4 +60,10 @@ export async function getExifData(image: ImageMetadata) {
}
return hasExif ? out : undefined;
} catch (error) {
console.log("Error reading EXIF data", error);
return undefined
}
}