Grafika\Gd\Editor::resizeExactHeight PHP 메소드

resizeExactHeight() 공개 메소드

Resize image to exact height. Width is auto calculated. Useful for creating row of images with the same height.
public resizeExactHeight ( Image &$image, integer $newHeight ) : Editor
$image Image
$newHeight integer Height in pixels.
리턴 Editor
    public function resizeExactHeight(&$image, $newHeight)
    {
        $width = $image->getWidth();
        $height = $image->getHeight();
        $ratio = $width / $height;
        $resizeHeight = $newHeight;
        $resizeWidth = $newHeight * $ratio;
        $this->_resize($image, $resizeWidth, $resizeHeight);
        return $this;
    }