Is it possible to set image quality when

Is it possible to set image quality when using Cloudflare Images? I see that you can when it's coming from a server and going through Cloudflare, but doesn't seem to work when the images are hosted by Cloudflare. This is a major blocker that's slowing down my site because everything is being served at original quality.
16 Replies
sdayman
sdayman2w ago
With Flexible Variants, you can set a Quality parameter: https://developers.cloudflare.com/images/manage-images/enable-flexible-variants/
Cloudflare Docs
Enable flexible variants | Cloudflare Image Optimization docs
Flexible variants allow you to create variants with dynamic resizing which can provide more options than regular variants allow. This option is not enabled by default.
Bakĉoj | Brandon
@sdayman That's what I'm using. I can set all kinds of parameters with it except for quality
sdayman
sdayman2w ago
Darn, you're right. Docs say Quality only applies to Transformations, so not for Flexible Variants: https://developers.cloudflare.com/images/transform-images/transform-via-url/#quality Same with Format
Bakĉoj | Brandon
Is there a workaround or anything? Can I send Cloudflare Images through Transformations?
sdayman
sdayman2w ago
Possibly, if you allow Transformations from any origin.
Bakĉoj | Brandon
I'll give it a shot Thanks for the help! In the meantime, any info on when Cloudflare will be adding those params to Flexible Variants? It didn't like that
Error 9524: image could not be resized (200)
Error 9524: image could not be resized (200)
https://ana.so/cdn-cgi/image/sharpen=2/https://imagedelivery.net/MRTPzGIpYfy00UVryjholQ/718d3515-4d46-42f5-fff8-09f17f9cef00/w=512 It seems to be specifically disallowing imagedelivery.net
Bakĉoj | Brandon
This is the hackyest hack I've ever seen @sdayman Do you think this is something that I can rely on until Flexible Variants gets official support for quality? I don't want to start using this just to have the rug pulled out from under me.
sdayman
sdayman2w ago
I don't see why that would stop working. You've allowed it to pull from any origin, and that's what it's doing.
Bakĉoj | Brandon
I've actuallly disabled it from pulling from any origin Technically, it's still getting it from the same origin If you look at the url, it's just pointing the /cdn-cgi/image/quality=2/ to /cdn-cgi/imagedelivery/, but that seems like a recursive call that might become patched at some point, even if accidental
sdayman
sdayman2w ago
Oh, right. You're using the custom domain URL. I wouldn't call that recursive. It's more like a request and a subrequest.
Want results from more Discord servers?
Add your server