Location: PHPKode > scripts > ISC > isc/class/ISC.class.php
class image{
	private $image;
	private $height;
	private $width;
	function getRatio($image, $newSize, $nSW = FALSE){
		//$image is the path to the image.
			return false;
		//We need to get the current sizes of the file:
		list($width, $height) = getimagesize($image);
		if(!ctype_digit($width) || !ctype_digit($height)){
			return false;
		//Now we need to work out the ratio:
		//Currently the ratio stands at $width:$height
		//We need to simplify it:
		if($width > $height){
			$ratio = $width/$height;
			$ratio = $height/$width;
		//We now need to make the new sizes up:
			//So the width is to be the longer side:
			$width = $newSize;
			$height = $newSize * $ratio;
			//So the height is to be the longer side:
			$height = $newSize;
			$width = $newSize / $ratio;
		$this->height = $height;
		$this->width = $width;
		$this->image = $image;
	function printHTML(){
		echo("<img src=\"".$this->image."\" height=\"".$this->height."\" width=\"".$this->width."\" />");
Return current item: ISC