public function scale( $width, $height, $fit = true )
	{
		if( ( $info = getimagesize( $this->_filename ) ) === false ) {
			throw new MW_Media_Exception( 'Unable to retrive image size' );
		}

		if( $fit === true )
		{
			list( $width, $height ) = $this->_getSizeFitted( $info[0], $info[1], $width, $height );

			if( $info[0] <= $width && $info[1] <= $height ) {
				return;
			}
		}

		if( ( $image = imagecreatetruecolor( $width, $height ) ) === false ) {
			throw new MW_Media_Exception( 'Unable to create new image' );
		}

		if( imagecopyresampled( $image, $this->_image, 0, 0, 0, 0, $width, $height, $info[0], $info[1] ) === false ) {
			throw new MW_Media_Exception( 'Unable to resize image' );
		}

		imagedestroy( $this->_image );
		$this->_image = $image;
	}
public function scale( $width, $height, $fit = true )
	{
		if( ( $info = getimagesize( $this->_filename ) ) === false ) {
			throw new MW_Media_Exception( 'Unable to retrive image size' );
		}

		if( $fit === true )
		{
			list( $width, $height ) = $this->_getSizeFitted( $info[0], $info[1], $width, $height );

			if( $info[0] <= $width && $info[1] <= $height ) {
				return;
			}
		}

		if( ( $image = imagecreatetruecolor( $width, $height ) ) === false ) {
			throw new MW_Media_Exception( 'Unable to create new image' );
		}

		if( imagecopyresampled( $image, $this->_image, 0, 0, 0, 0, $width, $height, $info[0], $info[1] ) === false ) {
			throw new MW_Media_Exception( 'Unable to resize image' );
		}

		imagedestroy( $this->_image );
		$this->_image = $image;
	}
public function scale ( $ width , $ height , $ fit = true ) { if ( ( $ info = getimagesize ( $ this -> _filename ) ) === false ) { throw new MW_Media_Exception ( 'Unable to retrive image size' ) ; } if ( $ fit === true ) { list ( $ width , $ height ) = $ this -> _getSizeFitted ( $ info [ 0 ] , $ info [ 1 ] , $ width , $ height ) ; if ( $ info [ 0 ] <= $ width && $ info [ 1 ] <= $ height ) { return ; } } if ( ( $ image = imagecreatetruecolor ( $ width , $ height ) ) === false ) { throw new MW_Media_Exception ( 'Unable to create new image' ) ; } if ( imagecopyresampled ( $ image , $ this -> _image , 0 , 0 , 0 , 0 , $ width , $ height , $ info [ 0 ] , $ info [ 1 ] ) === false ) { throw new MW_Media_Exception ( 'Unable to resize image' ) ; } imagedestroy ( $ this -> _image ) ; $ this -> _image = $ image ; }
Scales the image to the given width and height.

@param integer $width New width of the image
@param integer $height New height of the image
@param boolean $fit True to keep the width/height ratio of the image
Scales the image to the given width and height .