I'd like to be able to run crop and resize operations in my Astro files. The easiest way I can think to do this, instead of extending getImage , is to import sharp directly into my components and do the processing there.
Something like this. Very much pseudo-code.
import sharp from "sharp";
// Get an ImageMetadata object
import hero from "src/images/stock-gaming-landscape.jpg";
// Process it directly with sharp and export it as...something. File, buffer, etc.
const result = await sharp(hero.src)
.resize(2500, 1667)
.toFile("src/images/stock-gaming-landscape-modified.jpg");
---
<!-- Consume the result in an Image or img -->
<Image src={result} />