public function save($filename, $image_type = null, $quality = null)
	{
		$quality = (int) $quality;
		if (empty($quality)) {
			$quality = 100;
		}
		
		if (null === $image_type) {
			$image_type = $this->image_type;
		}
		
		switch ($image_type) {
			case 'gif':
			case IMAGETYPE_GIF:
				$success = imagegif($this->image, $filename);
				break;
				
			case 'png':
			case IMAGETYPE_PNG:
				$quality = 9 - round(($quality / 100) * 9);
				$success = imagepng($this->image, $filename, $quality);
				break;
				
			case 'jpeg':
			case 'jpg':
			case IMAGETYPE_JPEG:
			default:
				$success = imagejpeg($this->image, $filename, $quality);
				break;
		}
		
		return $success;
	}
public function save($filename, $image_type = null, $quality = null)
	{
		$quality = (int) $quality;
		if (empty($quality)) {
			$quality = 100;
		}
		
		if (null === $image_type) {
			$image_type = $this->image_type;
		}
		
		switch ($image_type) {
			case 'gif':
			case IMAGETYPE_GIF:
				$success = imagegif($this->image, $filename);
				break;
				
			case 'png':
			case IMAGETYPE_PNG:
				$quality = 9 - round(($quality / 100) * 9);
				$success = imagepng($this->image, $filename, $quality);
				break;
				
			case 'jpeg':
			case 'jpg':
			case IMAGETYPE_JPEG:
			default:
				$success = imagejpeg($this->image, $filename, $quality);
				break;
		}
		
		return $success;
	}
public function save ( $ filename , $ image_type = null , $ quality = null ) { $ quality = ( int ) $ quality ; if ( empty ( $ quality ) ) { $ quality = 100 ; } if ( null === $ image_type ) { $ image_type = $ this -> image_type ; } switch ( $ image_type ) { case 'gif' : case IMAGETYPE_GIF : $ success = imagegif ( $ this -> image , $ filename ) ; break ; case 'png' : case IMAGETYPE_PNG : $ quality = 9 - round ( ( $ quality / 100 ) * 9 ) ; $ success = imagepng ( $ this -> image , $ filename , $ quality ) ; break ; case 'jpeg' : case 'jpg' : case IMAGETYPE_JPEG : default : $ success = imagejpeg ( $ this -> image , $ filename , $ quality ) ; break ; } return $ success ; }
Saves the image to the given location at the given quality.

@param string         $filename
@param integer|string $image_type
@param integer        $quality

@return boolean
Saves the image to the given location at the given quality .