public static function aspect_ratio( $width, $height, $proper = false ) 
	{
		$ratio = $width / $height;

		if ( !$proper ) 
		{
			return $ratio;
		}

		$tolerance = 1.e-6;
		$h1=1; $h2=0;
		$k1=0; $k2=1;
		$b = 1/$ratio;

		do {
			$b = 1/$b;
			$a = floor($b);
			$aux = $h1; $h1 = $a*$h1+$h2; $h2 = $aux;
			$aux = $k1; $k1 = $a*$k1+$k2; $k2 = $aux;
			$b = $b-$a;

		} while ( abs( $ratio-$h1 / $k1 ) > $ratio * $tolerance );

		return $h1.":".$k1;
	}