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

Does this integrate with Cloudflare Images as well? #4

Open
ajtatum opened this issue Apr 14, 2024 · 3 comments
Open

Does this integrate with Cloudflare Images as well? #4

ajtatum opened this issue Apr 14, 2024 · 3 comments

Comments

@ajtatum
Copy link

ajtatum commented Apr 14, 2024

I'm considering Ghost CMS instead of another Wordpress site, but I have a WP plugin that saves images to Cloudflare images and thus WP doesn't save any size variants, and optionally the original image, and when a visitor comes to the site the image is shown with the exact dimensions required as detected by Cloudflare. In the end, it results in really clean images and no need to worry about image sizes whatsoever.

@egeldenhuys
Copy link
Owner

Hi @ajtatum,
Unfortunately this plugin only stores images in R2 and not in their Images product.

It might be possible to use Cloudflare's Image Transformation functionality to resize images served from R2 using this plugin, but would likely require some rules (on Cloudflare or Ghost) to rewrite the URL from something like /content/images/size/w{width}/... to https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>. I think the theme determined which sizes were used in the image URL.

Sorry for being vague, it has been a while since I worked with the Ghost API and images.

It would be nice to have a storage adapter that integrates with Cloudflare Images. I don't know of any at the moment.

@ajtatum
Copy link
Author

ajtatum commented May 26, 2024

Alrighty, gotcha thanks! Just out of curiosity, you mentioned it's been a while since working with the API, do you still use Ghost and do you think you'll continue to maintain this repo? Sorry, I'm new to Ghost and just want to try and get things right. Off topic, but I'm honestly kinda stuck on if I want to move forward with Ghost. I've used WordPress in the past and loved its extensibility, but hate how badly the plug-in ecosystem is (poorly written code). With Ghost, modifying anything built in seems like a chore.

@egeldenhuys
Copy link
Owner

I recently started using Ghost again so I will still be maintaining this repo and reviewing pull requests. I want to improve the documentation on how to contribute and install the storage adapter, as well as better testing and quality control.

Personally I will be storing my images in R2 until it makes more sense to store in Images (you can store about 333 GB of images before R2 becomes more expensive than Images storage at $5).

It seems the image transformations are quite expensive whereas the variants are included in the cost if you store the images within the Images product.

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

2 participants