Neos\Media\Domain\Model\DimensionsTrait::getAspectRatio PHP Метод

getAspectRatio() публичный Метод

Edge / aspect ratio of the image
public getAspectRatio ( boolean $respectOrientation = false ) : float
$respectOrientation boolean If false (the default), orientation is disregarded and always a value >= 1 is returned (like usual in "4 / 3" or "16 / 9")
Результат float
    public function getAspectRatio($respectOrientation = false)
    {
        if (!$this->hasDimensions()) {
            return 0;
        }
        $aspectRatio = $this->getWidth() / $this->getHeight();
        if ($respectOrientation === false && $aspectRatio < 1) {
            $aspectRatio = 1 / $aspectRatio;
        }
        return $aspectRatio;
    }