function waterText($filename,$text="ceshi2",$fontfile="simhei.ttf")
{
$fileInfo=getimagesize($filename);
$mime=$fileInfo['mime'];
$createFun=str_replace("/","createfrom",$mime);
$outFun=str_replace("/",null,$mime);
$image=$createFun($filename);
$color=imagecolorallocatealpha($image,255,0,0,50);
$fontfile="../fonts/{$fontfile}";
imagettftext($image,14,0,0,14,$color,$fontfile,$text);
// header("content-type:".$mime);
$outFun($image,$filename);
imagedestory($image);
}
function doWaterText($id)
{
$rows=getProImgsById($id);
foreach ($rows as $row)
{
$filename="../image_800/".$row['albumPath'];
waterText($filename);
}
$mes="操作成功";
return $mes;
}