ascorbic / unpic

Universal image CDN translator
https://unpic.pics/lib
305 stars 36 forks source link

Feature request: Support for Uploadcare CDN API #18

Closed maoosi closed 9 months ago

maoosi commented 1 year ago

Very nice library! Would love to see support for Uploadcare, which is a great image upload and delivery platform.

Image processing docs: https://uploadcare.com/docs/transformations/image/ Full API reference for images delivery: https://uploadcare.com/api-refs/url-api/

davedbase commented 1 year ago

I use Uploadcare heavily on a project and will likely be contributing this CDN adapter in a few weeks. My only concern is that it has support for a lot of extra transform modifiers. I might be incorrect but my understanding is that Unpic doesn't support a modifiers-like pattern, so the only benefit we get here is the basic scaling functionality.

Perhaps Unpic should consider a modifiers approach so that we can support every provider's unique abilities. ie. filters, effects, etc.

ascorbic commented 1 year ago

Hi. I need to explain it better, but the general idea is that it preserves any CDN-specific modifiers that are already in the URL, while allowing the other params to be modified. There could be something to be said for allowing more control over individual CDN params, but it's not in scope for now

danestves commented 10 months ago

I think I can work on this adapter, only if you are open to make some transformations of the URL on the adapter itself @ascorbic

Since Uploadcare doesn't use query params and instead use URL paths to make that, I want to know your opinion

ascorbic commented 10 months ago

Yes, that would be fine. If I'm understanding what you mean, there are several CDNs that work like that. See the Cloudinary transformer for an example, or IPX which is a simpler one.