fix: some stuff

This commit is contained in:
Max Richter
2025-10-25 13:55:48 +02:00
parent 2f08c7f4c2
commit f1e0654609
5 changed files with 46 additions and 11 deletions

View File

@@ -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 = [
{