Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add params prop #404

Open
el-schneider opened this issue Nov 21, 2023 · 2 comments
Open

Add params prop #404

el-schneider opened this issue Nov 21, 2023 · 2 comments

Comments

@el-schneider
Copy link

el-schneider commented Nov 21, 2023

Thanks for your great work on the unpic package. I appreciate the effort to solve image handling for everyone.

However, I find the limitation to only the most common parameters a bit restrictive. I'm looking to implement custom cropping with the Sanity CDN. Could we introduce a params prop for custom parameters? These would be added to the URL and ignored if the chosen/detected CDN doesn't support them.

Or else, how would you suggest I could go about supporting a custom crop for images?

@ascorbic
Copy link
Owner

There is a prop cdnOptions, which allows params to be passed to specific CDNs. It isn't implemented for all of them, but it could be used there. It's handled in the unpic lib

@el-schneider
Copy link
Author

Are you referring to this: https://unpic.pics/img/svelte/#cdn? Sorry for having to ask, but I'm not entirely sure how this would need to be used. I tried a couple of things with no effect. From what I understand sanity will be handled the same way imgix is handled, right? I tried using config options and passed them trough props cdn and cdnOptions

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants