title: Watermark overlay fluctuate in codeigniter
body: <p>When I use to do watermark overlay in codeigniter, the size of watermark image comes different for different dimension images. Following code is using for watermarking.  </p>
  
  <pre><code>function do_upload_img()
  {
      if(isset($_FILES['portfolioimg']['size']) != 0){
         $name_array = array();
         $files = $_FILES;
         $cpt = count($_FILES['portfolioimg']['name']);
  
         // $config['source_image'] = ''; //get original image
         $config['wm_type'] = 'overlay';
         $config['wm_overlay_path'] = './assets/img/watermark.png';
         $config['quality'] = 50;
         $config['wm_vrt_alignment'] = 'middle';
         $config['wm_hor_alignment'] = 'center';
         // $this-&gt;load-&gt;library('image_lib', $config);
  
         for($i=0; $i&lt;=$cpt-1; $i++)
         {           
             $_FILES['userfile']['name']= $files['portfolioimg']['name'][$i];
             $_FILES['userfile']['type']= $files['portfolioimg']['type'][$i];
             $_FILES['userfile']['tmp_name']= $files['portfolioimg']['tmp_name'][$i];
             $_FILES['userfile']['error']= $files['portfolioimg']['error'][$i];
             $_FILES['userfile']['size']= $files['portfolioimg']['size'][$i];    
  
             $imgnam = rand(10,1000000);
             $ext = pathinfo($files['portfolioimg']['name'][$i], PATHINFO_EXTENSION);
             if($this-&gt;upload-&gt;initialize($this-&gt;set_upload_options($imgnam))){
                 $data = $this-&gt;upload-&gt;do_upload();
                 $config['source_image'] = './assets/portfolio_img/' . 'Rookie_'.$imgnam.'.'.$ext;
                 $this-&gt;image_lib-&gt;initialize($config);
                 $this-&gt;image_lib-&gt;watermark(); 
                 $name_array[] = $this-&gt;upload-&gt;data('file_name');
             } else {
                 $this-&gt;session-&gt;set_flashdata('falsemsg','Only jpg, jpeg, png files are allowed to be uploaded.');
             }
  
         } 
         return $name_array;
      }else{
        return false;
      }
  }
  
  
  private function set_upload_options($imgnam)
  {   
       //upload an image options
       $config = array();
       $config['upload_path']   = './assets/portfolio_img/';
       $config['allowed_types'] = 'jpeg|jpg|png';
       $config['max_size']      = '0';
       $config['overwrite']     = true;
       $config['file_name']     = 'Rookie_'.$imgnam;
  
       return $config;
   } 
  </code></pre>
  
  <p>So please help me to fix this issue. I want the watermark image should be same size for all the images that I'm going to upload.  </p>
  
  <p>These are images I uploaded:  </p>
  
  <p><a href="https://imgur.com/a/trkB7" rel="nofollow noreferrer">image 1</a><br>
  <a href="https://imgur.com/a/coKeT" rel="nofollow noreferrer">image 2</a></p>
  
  <p>Thanks in advance :)</p>