cloudinary/responsive_breakpoints_generator

Aspect ratio crops off-center

skube opened this issue · 3 comments

skube commented

It seems to me when I try to use the Art Direction functionality, with any ratio other than 1:1 the cropping is a off center by a noticeable amount. Is this on purpose? Is there a way to override?

Edit: After some further reading, it appears this is by design. The algorithms are doing intelligent image cropping. I'm still wondering if there is a way to optionally override so images are always cropped to the center.

Hi, @skube. Can you please provide a couple of URL examples where the image is badly cropped, as you describe, so we can better understand the issue?

skube commented

I can provide an image but I don't think it's necessary. As I understand it, your Art Direction option trys to algorithmically determine the best area to crop in on. If I wanted to simply force the crop to occur on the exact center of the image - regardless of the content - what would be the best way to do that?

Hi, @skube. The art direction in the tool involves 2 parameters: aspect ratio and percent of the screen in each device resolution (e.g., 4:3 ratio image taking 30% of the screen on mobile devices).
A ratio that is different from the original image will indeed involve cropping. We use c_fill for cropping with g_auto for making sure that the relevant part is included in the image.
While the tool itself doesn't support g_center instead of g_auto, you can try and use the API directly for this.
Adding this ability to the tool is part of our future roadmap. We'll update here if and when this will be available.