RafidMuhymin / astro-imagetools

Image Optimization tools for the Astro JS framework
astro-imagetools-docs.vercel.app
MIT License
407 stars 44 forks source link

[question] Retain params in src url instead of parsing and treating as props? #43

Open ekafyi opened 2 years ago

ekafyi commented 2 years ago

Hi, thanks for the great work.

I notice that query parameters in the src URL are parsed and passed as props to the underlying API.

Example:

<Picture src="https://images.unsplash.com/photo-1520520731457-9283dd14aa66?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb" alt="something" />

Strips off the image parameters and produces these warning:

[astro-imagetools]  ixlib  is not a valid Picture Config Option
[astro-imagetools]  q  is not a valid Picture Config Option
[astro-imagetools]  fm  is not a valid Picture Config Option
[astro-imagetools]  crop  is not a valid Picture Config Option
[astro-imagetools]  cs  is not a valid Picture Config Option

Is it possible to make the Picture component process the full URL without parsing the query parameters that way?

Thank you!

RafidMuhymin commented 2 years ago

It's really a major issue and I too have faced this many times. Thanks for opening an issue on GitHub.

gbouteiller commented 1 year ago

I encountered the same issue with images from Notion SDK : image urls contain security params to be displayed but these params are removed by the plugin. Would it be possible to have a config option for that? Thank you!