|
本帖最后由 S┢┦éé卪√ 于 2011-11-30 12:33 编辑
PHP复制代码
//生成缩略图
$config['source_image'] = $full_path;
$config['width'] = 220;
$config['height'] = 160;
$config['quality'] = 90;
$new_image = 'W0'.date('YmdHis').rand(10000, 99999).$file_ext;
$config['new_image'] = $file_path.$new_image;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
unlink($full_path);
$this->image_lib->clear();
//添加水印
$config['source_image'] = $file_path.$new_image;
$config['wm_text'] = 'Copyright 2006 - John Doe';
$config['wm_type'] = 'text';
// $config['wm_font_path'] = './system/fonts/texb.ttf';
$config['wm_font_size'] = '16';
$config['wm_font_color'] = '000000';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'center';
$config['wm_padding'] = '20';
$this->image_lib->initialize($config);
$this->image_lib->watermark();
复制代码
想要达到的效果:生成缩略图,并且在缩略图上面添加水印
现在执行结果:生成了缩略图,缩略图上面没有水印。。
求帮助。。
|
|