--- import { Image, getImage } from "astro:assets"; const { src, alt, width, height, ...attrs } = Astro.props; // if h/w attributes are declared, use them. If not, use from the source file const imgHeight = height ? height : src.height; const imgWidth = width ? width : src.width; // compute avif and webp format in order to use inside a element const imgAvif = await getImage({ src: src, format: "avif", width: Number(imgWidth), height: Number(imgHeight), }); const imgWebp = await getImage({ src: src, format: "webp", width: Number(imgWidth), height: Number(imgHeight), }); --- {alt