$file->ratio()

Returns the ratio of an image file

  • return (float)

Example

echo $page->image('my-image.jpg')->ratio();
// i.e. 1.345232

2.3.0 +

Crop the image by ratio

You can also pass a ratio to crop the image accordingly

echo $page->image('my-image.jpg')->ratio(3/2);