src/Image/Driver/Gd.php
protected function getDimensions($newWidth, $newHeight)
    {
        $usedRatio = $widthRatio = $this->width / $newWidth;
        $heightRatio = $this->height / $newHeight;

        if ($heightRatio < $widthRatio) {
            $usedRatio = $heightRatio;
        }

        $height = $this->height / $usedRatio;
        $width = $this->width / $usedRatio;

        return [$width, $height];
    }
protected function getDimensions($newWidth, $newHeight)
    {
        $usedRatio = $widthRatio = $this->width / $newWidth;
        $heightRatio = $this->height / $newHeight;

        if ($heightRatio < $widthRatio) {
            $usedRatio = $heightRatio;
        }

        $height = $this->height / $usedRatio;
        $width = $this->width / $usedRatio;

        return [$width, $height];
    }
protected function getDimensions ( $ newWidth , $ newHeight ) { $ usedRatio = $ widthRatio = $ this -> width / $ newWidth ; $ heightRatio = $ this -> height / $ newHeight ; if ( $ heightRatio < $ widthRatio ) { $ usedRatio = $ heightRatio ; } $ height = $ this -> height / $ usedRatio ; $ width = $ this -> width / $ usedRatio ; return [ $ width , $ height ] ; }
Get the Width & height of the Image
@param int $newWith
@param int $newHeight
@return array
Get the Width & height of the Image