feat: show recipe image on page
Some checks failed
Deploy to SFTP Server / build (push) Failing after 1m31s

This commit is contained in:
Max Richter
2025-10-22 16:24:04 +02:00
parent 24a66940e9
commit d9a2f63865
5 changed files with 27 additions and 16 deletions

View File

@@ -15,6 +15,8 @@ export async function generateThumbHash(
const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath ??
image.src;
if (!imagePath) return;
let sp;
if (imagePath.startsWith("https://") || imagePath.startsWith("http://")) {
const res = await fetch(imagePath);
@@ -72,6 +74,8 @@ export async function getExifData(image: ImageMetadata) {
const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath ??
image.src;
if (!imagePath) return undefined;
try {
let buffer: ArrayBuffer;
if (imagePath.startsWith("https://") || imagePath.startsWith("http://")) {