Crop images by ratio?

The new blocks field has a $block->ratio() variable when an image is being used and the user selects a crop but how do I use this with the $file->crop() function which only takes width and height as parameters?
Referring to this snippet in particular:

Any pointers or am I missing something obvious?

You calculate the desired width and heights depending on the ratio.

So you would end up for example with crop(700,500) or whatever.

1 Like

Cheers!