Image Creation

Because 'imagejpeg', 'imagegif' and 'imagepng' has their own parameters especially quality value, following function is required if you want to customize quality value.
	private function write_image($new_img, $new_file_path, $write_image){
		if($write_image == 'imagepng'){
			return $write_image($new_img, $new_file_path, 0);
		}else if($write_image == 'imagegif'){
			return $write_image($new_img, $new_file_path);
		}else{
			return $write_image($new_img, $new_file_path, 100);
		}
	}

http://php.net/manual/en/function.imagepng.php

http://tw1.php.net/manual/en/function.imagejpeg.php

http://tw1.php.net/manual/en/function.imagegif.php