unpic
unpic copied to clipboard
How I can use local image? (imgix web-folder or cloudflare image resizing)
I'm encountering difficulties while trying to use unpic's Astro ImageService with imgix's "web-folder" style setup. Here are the details:
Current Problem
The Astro Image component always renders URLs with an http:/n/
domain.
I can't find options to use imgix's "web-folder" style, which would allow me to add my imgix (or my own) domain.
Desired
I want to use local images from my project but serve them through Image CDNs. Ideally, the service should support private domains (like example.imgix.net or a custom domain) and wrap the source image URL.
Similar Features in Other Services:
Cloudflare's image optimization behaves similarly, using a URL structure like:
https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>
For reference: https://developers.cloudflare.com/images/transform-images/transform-via-url/
In Cf pages, it can write related URL.
Suggested Solutions:
1 Add a base option to the ImageService to specify the base URL for image processing. 2. For Cloudflare Pages users, implement Cloudflare image optimization for related URLs.
These additions would greatly improve the flexibility of the ImageService, especially for users who want to leverage their own domains or existing CDN setups.