GdThumb::calcImageSize PHP Method

calcImageSize() protected method

These calculations are based on both the provided dimensions and $this->maxWidth and $this->maxHeight
protected calcImageSize ( integer $width, integer $height )
$width integer
$height integer
    protected function calcImageSize($width, $height)
    {
        $newSize = array('newWidth' => $width, 'newHeight' => $height);
        if ($this->maxWidth > 0) {
            $newSize = $this->calcWidth($width, $height);
            if ($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
                $newSize = $this->calcHeight($newSize['newWidth'], $newSize['newHeight']);
            }
        }
        if ($this->maxHeight > 0) {
            $newSize = $this->calcHeight($width, $height);
            if ($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
                $newSize = $this->calcWidth($newSize['newWidth'], $newSize['newHeight']);
            }
        }
        $this->newDimensions = $newSize;
    }