lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

Image: Local images from public need size attributes

Open panwauu opened this issue 3 years ago • 0 comments

What version of astro are you using?

1.2.6

Are you using an SSR adapter? If so, which one?

Vercel

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the Bug

In the docs under width we can read:

Dimensions are optional for local images, the original image size will be used if not provided.

For remote images, the integration needs to be able to calculate dimensions for the optimized image. This can be done by providing width and height or by providing one dimension and an aspectRatio.

But since local images from public are loaded like remote images this is not the case anymore for local images in public. I think this feature would be really nice to be added again. I personally would like to use it. Ideally we could specify nothing (-> keep size) or either width or height (-> keep aspectRatio of original)).

Link to Minimal Reproducible Example

.

Participation

  • [ ] I am willing to submit a pull request for this issue.

panwauu avatar Sep 20 '22 10:09 panwauu