if ( ! function_exists('WaterImg')){function WaterImg($srcFile, $fromGo='up'){include(DEDEDATA.'/mark/inc_photowatermark_config.php');require_once(DEDEINC.'/image.class.php');if( isset($GLOBALS['needwatermark']) ){$photo_markup = $photo_markdown = empty($GLOBALS['needwatermark']) ? '0' : '1';}if($photo_markup != '1' || ($fromGo=='collect' && $photo_markdown!='1') ){return;}$info = '';$srcInfo = @getimagesize($srcFile,$info);$srcFile_w = $srcInfo[0];$srcFile_h = $srcInfo[1];if($srcFile_w < $photo_wwidth || $srcFile_h < $photo_wheight){return;}if($fromGo=='up' && $photo_markup=='0'){return;}if($fromGo=='down' && $photo_markdown=='0'){return;}$TRUEMarkimg = DEDEDATA.'/mark/'.$photo_markimg;if(!file_exists($TRUEMarkimg) || empty($photo_markimg)){$TRUEMarkimg = "";}if($photo_waterpos == 0){$photo_waterpos = rand(1, 9);}$cfg_watermarktext = array();if($photo_marktype == '2'){if(file_exists(DEDEDATA.'/mark/simhei.ttf')){$cfg_watermarktext['fontpath'] = DEDEDATA.'/mark/simhei.ttf';}else{return ;}}$cfg_watermarktext['text'] = $photo_watertext;$cfg_watermarktext['size'] = $photo_fontsize;$cfg_watermarktext['angle'] = '0';$cfg_watermarktext['color'] = '255,255,255';$cfg_watermarktext['shadowx'] = '0';$cfg_watermarktext['shadowy'] = '0';$cfg_watermarktext['shadowcolor'] = '0,0,0';$photo_marktrans = 85;$img = new image($srcFile,0, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $photo_marktype, $photo_marktrans,$TRUEMarkimg);$img->watermark(0);}}
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛