第二步:找到phpcms/libs/classes/image.class.php文件中watermark函數,將此函數中$w_text 參數的值設置為空即可
function watermark($source, $target = '', $w_pos = '', $w_img = '', $w_text = '',$w_font = 8, $w_color = '#ff0000') { $w_pos = $w_pos ? $w_pos : $this->w_pos; $w_img = $w_img ? $w_img : $this->w_img; if(!$this->watermark_enable || !$this->check($source)) return false; if(!$target) $target = $source; $w_img = PHPCMS_PATH.$w_img; $source_info = getimagesize($source); $source_w = $source_info[0]; $source_h = $source_info[1];
如果想替換為自己設計的水印圖片,則只需要替換statics/images/water文件夾下的水印圖片為自己設計的水印圖片即可。
如果想給自己上傳的圖片添加文本格式的水印,則除了需要刪除statics/images/water文件夾外,還需要將watermark函數中的$w_text參數的值修改為自己想要的文字即可。
新聞熱點
疑難解答