image watermarking problem

#1
[eluser]Bigil Michael[/eluser]
this is the code used to upload an image with water making. upload image run successfully but it wouldn't do watermarking can anyone help to solve this problem.

$config['upload_path'] = absolute_path().'images/products/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1024';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('photo'))
{
$data['alert'] = $this->upload->display_errors();
$this->load->view('admin/product/add', $data);
}
else
{
$upload_data = $this->upload->data();
$filename = $upload_data['file_name'];
$width = $upload_data['image_width'];
$height = $upload_data['image_height'];
$config1 = array();
$this->load->library('image_lib');
$config1['source_image'] = absolute_path().'images/products/'.$filename;

$config1['image_library'] = 'gd2';
$config1['wm_text'] = 'Copyright 2006 - John Doe';
$config1['wm_type'] = 'text';
$config1['wm_font_path'] = './system/fonts/texb.ttf';
$config1['wm_font_size'] = '16';
$config1['wm_font_color'] = '000000';
$config1['wm_vrt_alignment'] = 'bottom';
$config1['wm_hor_alignment'] = 'center';
$config1['wm_padding'] = '20';
$this->image_lib->initialize($config1);
if(!$this->image_lib->watermark()){
echo $this->image_lib->display_errors();
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.