Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to add watermark in Codelgniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 90
    Comment on it

    Hello Friends,

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: