From 0db489269b03f35c07935d7da877bd3da0d17c03 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 22 Oct 2025 14:20:34 +0200 Subject: [PATCH] fix: image loading stuff --- src/components/Image.astro | 10 ++++++---- src/helpers/memorium.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Image.astro b/src/components/Image.astro index 50fb63f..3ce039a 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -19,10 +19,12 @@ async function checkImage(src: string) { const res = await fetch(src); if (res.ok) { return true; - } + }else { + console.log("Failed to fetch: ", src); + } return false; } catch (err) { - console.log("Failed to fetch: ",src); + console.log("Failed to fetch: ", src); return false; } } @@ -39,7 +41,7 @@ const { let thumbhash = hash && image.fsPath ? await generateThumbHash(image) : ""; const imageOk = await checkImage(image.src); -let exif = await getExifData(image); +let exif = imageOk && (await getExifData(image)); const sizes = [ { @@ -78,5 +80,5 @@ const sizes = [ .join(", ")}> - ) : undefined + ) : "Image not ok" } diff --git a/src/helpers/memorium.ts b/src/helpers/memorium.ts index 1e04258..956f5cb 100644 --- a/src/helpers/memorium.ts +++ b/src/helpers/memorium.ts @@ -23,7 +23,7 @@ export type MemoriumEntry = MemoriumFile | MemoriumDir; export async function listResource( id: string, ): Promise { - const url = `https://marka.max-richter.dev/${id}`; + const url = `https://marka.max-richter.dev/resources/${id}`; console.log("Fetching: ", url); try { const response = await fetch(url);