php读取中文图片文件读不了,编码问题
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?php $image='小图.jpg'; $percent=0.05; $im=getimagesize($image); $width=$im[0]; $hight=$im[1]; switch ($im[2]) { case 1: $im=@imagecreatefromgif($image); break; case 2: $im=@imagecreatefromjpeg($image); break; case 3: $im=@imagecreatefrompng($image); break; } $logo='1.jpg'; $im1=getimagesize($logo); //print_r($im1); switch ($im1[2]) { case 1: $im1=@imagecreatefromgif($logo); break; case 2: $im1=@imagecreatefromjpeg($logo); break; case 3: $im1=@imagecreatefrompng($logo); break; } imagecopy($im, $im1, 700,-100,0,0,'440','771'); // 底下图 上面图 $te=imagecolorallocate($im,255,255,255); imagettftext($im,12,0,20,20,$te,'../simhei.ttf','新年快乐'); $newwidth=$width*$percent; $newheight=$hight*$percent; $new=imagecreatetruecolor($newwidth,$newheight); imagecopyresized($new,$im,0,0,0,0,$newwidth,$newheight,$width,$hight); header("Content-type: image/jpeg"); imagejpeg($new);//编译图片 //if(imagejpeg($im,'new.jpg')){ // echo "水印成功"; //} //imagejpeg($new,'小图.jpg'); //imagejpeg($im,'大图.jpg'); ?>