public function readImage( $file, $type) {
		switch ($type) {
			case 2:	//JPEG
			return(ImageCreateFromJPEG($file));
			break;
			
			case 3:	//PNG
			return(ImageCreateFromPNG($file));
			break;
			
			default:
			$this->errorMsg="File format not supported.";
			return(false);
		}
	}