[eluser]Sanity11[/eluser]
Hi all,
I want to upload a image and immediately create a copy with a watermark.
First I want to get the watermarking working:
Code:
function do_upload()
{
$data = $this->od_model->general();
$config['upload_path'] = './images/uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '200';
$config['max_width'] = '1024';
$config['max_height'] = '1280';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$upload_info = array('error' => $this->upload->display_errors());
$this->images($upload_info);
}
else
{
$upload_info = array('upload' => $this->upload->data());
$this->od_model->insert_image_data($upload_info['upload']['file_name']);
//Maak na de upload direct de afbeelding met het watermerk aan.
$this->load->library('image_lib');
$config_wat['source_image'] = $data['uploaded_images_path'] . $upload_info['upload']['file_name'];
$config_wat['wm_text'] = 'VERKOCHT!';
$config_wat['wm_type'] = 'text';
$config_wat['wm_font_path'] = $data['base_system_url'] . 'fonts/texb.ttf';
$config_wat['wm_font_size'] = '40';
$config_wat['wm_font_color'] = 'ff0000';
$config_wat['wm_vrt_alignment'] = 'center';
$config_wat['wm_hor_alignment'] = 'center';
$config_wat['wm_padding'] = '20';
$this->image_lib->initialize($config_wat);
$this->image_lib->watermark();
//Als alles klaar is wordt de functie images aageroepen. Deze herlaadt de pagina zodat de updates zichtbaar zijn.
$this->images($upload_info);
}
}
This code makes the image upload perfectly. But there is no watermark..? Can someone help me identify the problem?