Getting image dimensions / ratio in K3

Hey,

I used to use the $image->isLandscape() and isPortrait() function often when handling images in order to apply an appropriate class to create a ratio box in CSS. I can’t seem to find or replicate this functionality in the new Kirby — any suggestions?

Cheers,

$image->isLandscape(), $image->isSquare(), $image->isPortrait() are available. Also $image->dimensions()->orientation() and $image->dimensions()->ratio()

1 Like

These methods are currently missing from the docs. There’s an issue on Github.