Cropping 3:2 in case width > height, 2:3 in case width < height

Hi,
My goal is to have all images either with an aspect ratio of 2:3 or 3:2. I’m wondering if it’s possible to force the widget to crop to 3:2 when the image width > height, and force 2:3 when width < height. When I set up the widget with the parameter data-crop=“2:3,3:2” it selects 2:3 by default and the user has to manually switch to 3:2 in case the image is a landscape.
Thanks.

Hey,
I just implemented this functionality based off this codepen: Change crop preset depending on image orientation

You need to upload the image first, then launch the crop dialogue (otherwise it won’t know the dimensions to calculate the orientation)

1 Like