Closed joe-bell closed 1 year ago
The problem is that we don't know what attributes the configured image service is returning. Sure, the default ones do return width
, height
, loading
etc, but a custom one might not.
I've been trying to think of a way to allow users to extend that, but unfortunately the usual "allow users to define an interface and merge it" doesn't work because of how image services are loaded, so I'm still at the thinking phase on that one 😓
What version of
astro
are you using?2.4.5
Are you using an SSR adapter? If so, which one?
Vercel
What package manager are you using?
pnpm
What operating system are you using?
Max
What browser are you using?
N/A
Describe the Bug
I recently shipped an example for
plaiceholder
using the experimental (and wonderful) "assets" feature https://github.com/joe-bell/plaiceholder/blob/main/examples/astroOne minor thing that I've had to patch around for now, is that an image's
attributes
are a bit looser than I would expect: https://github.com/joe-bell/plaiceholder/blob/main/examples/astro/src/pages/base64/multiple.astro#L18My expectation here would be that
getImage()
is at least retrieving theheight
/width
for me (that's what's outputted, but the types don't reflect that currently)Thanks again for all your work on this feature, having a blast :rock
Link to Minimal Reproducible Example
https://github.com/joe-bell/plaiceholder/blob/main/examples/astro
Participation