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