If you are looking to add watermark in the images under Codelgniter framework. Please follow the below code for the same:
// Set your source image path
$watermark_config['source_image'] = '/define/path/of/your/image';
// Add your watermark text here
$watermark_config['wm_text'] = 'Click by Vivek Rastogi';
$watermark_config['wm_type'] = 'text';
// If you have custom font please speficy the the path
$watermark_config['wm_font_path'] = './system/fonts/texb.ttf';
// Define font size, color and alignment
$watermark_config['wm_font_size'] = '16';
$watermark_config['wm_font_color'] = 'ffffff';
$watermark_config['wm_vrt_alignment'] = 'bottom';
$watermark_config['wm_hor_alignment'] = 'center';
$watermark_config['wm_padding'] = '20';
//Intialize watermark
$this->image_lib->initialize($watermark_config);
$this->image_lib->watermark();
0 Comment(s)