在PHP的CodeIgniter中,文本水印消失了。在代码之后,它显示成功,但是当我检查输出图像时,文本未显示。
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image']='./uploads/user_certificates/certificate_model.jpg';
$config['new_image']='./uploads/user_certificates/test5.jpg';
$config['wm_text']='sample text';
$config['wm_type']="text";
$config['wm_font_path']="./assets/frontend/webfonts/fa-regular-400.ttf";
$config['wm_font_size'] = 46;
$config['wm_font_color'] = '#453344';
$config['wm_vrt_alignment'] = 'top';
$config['wm_hor_alignment'] = 'left';
$this->image_lib->initialize($config);
$this->image_lib->watermark();
//$this->image_lib->initialize($config);
if (!$this->image_lib->watermark()) {
echo $this->image_lib->display_errors();
} else {
echo 'Successfully updated image with watermark';
}