From 151f7ae3d0f6ac21d7b7e5a33a9c575890193ca1 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sat, 25 Oct 2025 13:55:48 +0200 Subject: [PATCH] fix: some stuff --- src/components/Image.astro | 11 +++--- src/components/resources/Recipe.astro | 4 +-- src/helpers/image.ts | 36 +++++++++++++++++++ src/helpers/memorium.ts | 2 +- .../resources/[resourceType]/index.astro | 4 +-- 5 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/components/Image.astro b/src/components/Image.astro index 5e47874..bf6c21f 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -2,7 +2,7 @@ import type { ImageMetadata } from "astro"; import { Picture as AstroImage } from "astro:assets"; import { inferRemoteSize } from "astro/assets/utils"; -import { generateThumbHash, getImageBuffer, getExifData } from "@helpers/image"; +import { getProcessedImage } from "@helpers/image"; interface Props { src: ImageMetadata & { fsPath?: string; src?: string }; alt: string; @@ -45,12 +45,11 @@ const { thumbnail = false, } = Astro.props; - - const imageOk = await checkImage(image); -const imageBuffer = imageOk && (await getImageBuffer(image)); -let thumbhash = imageBuffer && (await generateThumbHash(imageBuffer)); -let exif = imageBuffer && (await getExifData(imageBuffer)); + +const { thumbhash, exif } = imageOk + ? await getProcessedImage(image) + : { thumbhash: undefined, exif: undefined }; const definedSizes = [ { diff --git a/src/components/resources/Recipe.astro b/src/components/resources/Recipe.astro index 5f6526c..5306128 100644 --- a/src/components/resources/Recipe.astro +++ b/src/components/resources/Recipe.astro @@ -17,7 +17,7 @@ const instructions = resource?.content?.recipeInstructions || [];

Ingredients