//讀取影像的類型
//1 = GIF, 2 = JPG, 3 = PNG, 4 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13〠= SWC. $filename) {return (($imginfo=@getimagesize ($filename))!=null ? $imginfo[2] : null);}
//影像銳利化
//$scr_im、影像銳利化
//$scr_im/影像銳利度數柄數, (&$src_im, &$dst_im, $degree)
{
$src_x = imagesx($s〠);
//$dst_im = imagecreate( $src_x, $src_y);
//imagecopy($dst_im, $src_im, 0, 0, 0, 0, 🎜> for ($x =1; $x for ($y=1; $y $src_clr2 = imagecolorsforindex($src_im, imagecolorat($src_im, $x, $yrc_im, imagecolorat($src_im, $0,$$y)); red "]+$degree*($src_clr2["red"]-$src_clr1["red"]));
$g = intval($src_clr2["green"]+$degree*($src_clr2["green"]+$degree*($sgreen_clr2["green"]+$degree*($sgreen_clr2["green"]+$degree*($sgreen_clr2 "]-$src_clr1["green"]));
$b = intval($src_clr2["blue"]+$degree*($src_clr2["blue"]-$src_clr1"blue*($src_clr2["blue"]-$src_clr1"blue" ;
$r = min(255, max($r, 0));
$g = min(255, max($g, 0));
$b = min(255, max ($b, 0));
//echo "r:$r, g:$g, b:$b
";
if. r, $g, $b))==-1)
$dst_clr = Imagecolorallocate($dst_im, $r, $g, $ st_clr== -1) die("color allocate faile at $x, $y ($cnt).");
imagesetpixel($ return $ dst_im;
}
$ImageFunctions = array("imagecreatefromwbmp》 🎜> if (!empty($_POST["ImageName"]))
{
set_time_limit(10*60);
if (($ImageType=G.==ImageType($_POST["Image)或不是有效的圖片或不支援類型! ");
if ($ImageType==6) $ImageType = 0;
if ($ImageType>3) die("不支援的圖片類型!");
$im1 = $ImageFunctions[$ImageType]($_POST["ImageName"]);
$im2 = $ImageFunctions[ImageType]$im2 = $ImageFunctions[$Image)( 🎜> //print_r(imagecolorsforindex($im, imagecolorat($im, 10, 10)));
鋒利($im1, $im2, $_POST["程度"]);
正文header("內容類型" : image/png");
🎜imagepng($im2);
🎜imagedestroy($im1);
🎜>🎜 🎜>🎜>