I want the images to be cropped square. The src value produces a cropped image OK, but the values in data-src don’t, they just resize the image to each width and scale the image proportionally.
@tyssen did you figure out how to achieve this. I tried the exact same thing. but that just causes an error in the filename. I just want a square cropped iamge!
I’m having the same issue - it doesnt seem possible to ‘crop’ a square image that is output through a lazysizes srcset loop. E.g. in the following code:
If you change ‘data-aspectratio’ to = 1 (so a square aspect ratio), it has no bearing.
If you add crop: center to the img_url argument, that only outputs a single 1x1 file (i guess because the url structure now changes to have _crop_center at the end so the replace looking for ‘_1x1.’ doesnt work):
Even if you try and change the replace statement to target ‘1x1’ (to account for the fact that there is now a _crop_center at the end of the url), there doesnt seem to be a way to replace the x1 height declaration. For example this doesnt end up cropping the image: