Hello! I'm trying to insert a watermark when registering the image, but the image is up, but it does not insert the watermark or return errors, does anyone have any suggestions?
Follow the code below:
foreach ($_FILES as $field => $file) {
if ($file['error'] == 0) {
if ($this->upload->do_upload($field)) {
$data = $this->upload->data();
$dados['imagem'] = $data['file_name'];
$img_config['wm_type'] = 'overlay';
$img_config['wm_overlay_path'] = PATH_FRONT_END_UPLOAD.'usuarios/logo.png';
$img_config['wm_x_transp'] = 20;
$img_config['wm_y_transp'] = 10;
$img_config['wm_opacity'] = 50;
$img_config['wm_vrt_alignment'] = 'bottom';
$img_config['wm_hor_alignment'] = 'center';
$config['source_image'] = $data['full_path'];
$this->image_lib->watermark();
$this->image_lib->clear();
$this->image_lib->initialize($config);
} else {
$errors = $this->upload->display_errors();
die($errors);
}
}
}