|
想做成一个水印是按照图像的大小随机先生成缩略图,然后在生成水印
但是当我将图片生成缩略图后去生成水印但是没有成功,不知道是什么愿意,
难道不能同时使用image中的两个函数,我觉得不应该是这样的
PHP复制代码
$width = $orig_width/5;
$height = $orig_height/5;
$sl_config['image_library'] = 'gd2';
$sl_config['source_image'] = $logo_src;
$sl_config['create_thumb'] = TRUE;
$sl_config['maintain_ratio'] = TRUE;
$sl_config['width'] = $width;
$sl_config['height'] = $height;
$CI->image_lib->initialize($sl_config);
$CI->image_lib->resize();
//生成的缩略图的水印图片的地址
$config['wm_overlay_path']= '../water/apparatus_water_thumb.png';
//添加的图片的水印
$config['source_image'] = $img_src;
$config['wm_type'] = 'overlay';
$config['quality'] = 100;
$config['wm_opacity'] = '50';//透明度
$config['wm_vrt_alignment'] = 'top';
$config['wm_hor_alignment'] = 'left';
$config['new_image'] = $result_src;
var_dump($config);
$CI->image_lib->initialize($config);
复制代码
|
|