#Buffer to Image src
1 messages · Page 1 of 1 (latest)
I'm sorry, but based on the provided knowledge sources, there is no direct information about using a Buffer from Sharp as a source in Astro's getImage, Image, or Picture.
Astro's getImage, Image, and Picture components require the src attribute to be either an image that has been ESM imported or a string with the path of a remote image.
For example, you can use an ESM imported image like this:
import { Image } from "astro:assets";
import myImage from "../assets/my_image.png";
<Image src={myImage} alt="..." />
Or a string with the path of a remote image like this:
<Image src="<https://example.com/logo.png"> width={300} height={300} alt="..." />
You can find more details about this in the ExpectedImage error documentation (https://docs.astro.build/en/reference/errors/expected-image/#_top).