Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How I can use local image? (imgix web-folder or cloudflare image resizing) #132

Open
gentksb opened this issue Jul 19, 2024 · 0 comments
Open

Comments

@gentksb
Copy link

gentksb commented Jul 19, 2024

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.

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

No branches or pull requests

1 participant