public function resize_fit($width, $height) {
        if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height)))
            return true;
        if (!$width || (($height / $width) < ($this->height / $this->width)))
            $width = intval(($this->width * $height) / $this->height);
        elseif (!$height || (($width / $height) < ($this->width / $this->height)))
            $height = intval(($this->height * $width) / $this->width);
        if (!$width) $width = 1;
        if (!$height) $height = 1;
        return $this->resize($width, $height);
    }
public function resize_fit($width, $height) {
        if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height)))
            return true;
        if (!$width || (($height / $width) < ($this->height / $this->width)))
            $width = intval(($this->width * $height) / $this->height);
        elseif (!$height || (($width / $height) < ($this->width / $this->height)))
            $height = intval(($this->height * $width) / $this->width);
        if (!$width) $width = 1;
        if (!$height) $height = 1;
        return $this->resize($width, $height);
    }
public function resize_fit ( $ width , $ height ) { if ( ( ! $ width && ! $ height ) || ( ( $ width == $ this -> width ) && ( $ height == $ this -> height ) ) ) return true ; if ( ! $ width || ( ( $ height / $ width ) < ( $ this -> height / $ this -> width ) ) ) $ width = intval ( ( $ this -> width * $ height ) / $ this -> height ) ; elseif ( ! $ height || ( ( $ width / $ height ) < ( $ this -> width / $ this -> height ) ) ) $ height = intval ( ( $ this -> height * $ width ) / $ this -> width ) ; if ( ! $ width ) $ width = 1 ; if ( ! $ height ) $ height = 1 ; return $ this -> resize ( $ width , $ height ) ; }
Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure
@param integer $width
@param integer $height
@return bool
Resize image to fit in given resolution . Returns TRUE on success or FALSE on failure