3 ms·
next/image is a particularly poorly built piece of NextJS in my opinion. At least the last time I used it (around a year ago), their was very little support fo
by _heimdall 2y ago
next/image is a particularly poorly built piece of NextJS in my opinion.
At least the last time I used it (around a year ago), their was very little support for basic image transforms. Image resizing and cropping, for example, would always ignore the height provided and resize to the requested width. Any change to aspect ratio was done via a div wrapper and CSS, the image itself wasn't actually cropped to the requested aspect ratio.
This complaint is less about Next as many image services do it, but I've never liked the idea of an image service returning an image format other than what was requested. Deciding what image file size and format to request is a browser concern, the back end should just serve up what was requested rather than trying to cleverly decide the "best" format based on request headers.