News for hackers. Stuff that matters.
Re:Issues with Cloudflare Images by gregbrimble on Tuesday December 07, 2021 @12:58PM (#29475899)
I think "scale-down" is the closest to what you're after. If you have a 400x600 original, and request 512x512, you'll be served a 341x512 image. This maintains the original image's aspect ratio, and a fits within the requested (512x512) size.

Original: https://via.placeholder.com/400x600 Resized: https://gregbrimble.com/cdn-cgi/image/fit=scale-down,w=512,h...

Re:Issues with Cloudflare Images by LukeLambert on Tuesday December 07, 2021 @01:28PM (#29476287)
I want to maintain the aspect ratio of my crop, not that of the source image. Perhaps `fit=cover-scale-down` would be a more appropriate name. In other words, I always want a square image <= 512px wide. I think this is a very common use case.
Re:Issues with Cloudflare Images by rhizome on Tuesday December 07, 2021 @02:15PM (#29476932)
If there's no way to specify where the center (or w/e) of your crop is on the source image, it's not going to happen.
Re:Issues with Cloudflare Images by Aeolun on Tuesday December 07, 2021 @07:47PM (#29480105)
Even I can do ‘most interesting part’ detection. CF certainly can.