title: Resize and rotate image - Codeigniter
body: <p>I'm trying to resize and rotate a image.</p>
  
  <p>At the moment it's only resizing the image, but not rotate it.</p>
  
  <p>Here is the code, hope someone have a solution or something :-)</p>
  
  <pre><code>$config['image_library']   = 'gd2';
  $config['source_image']    = $data['full_path'];
  $config['new_image']       = $data['file_path'].'thumbs/'.$data['file_name'];
  $config['create_thumb']    = FALSE;
  $config['maintain_ratio']  = TRUE;
  $config['width']           = 235;
  $config['height']          = 235;
  
  $this-&gt;load-&gt;library('image_lib', $config); 
  
  $this-&gt;image_lib-&gt;resize();
  
  $this-&gt;image_lib-&gt;clear();
  
  $config['create_thumb'] = FALSE; //No thumbnail
  $config['source_image'] = $data['file_path'].'thumbs/'.$data['file_name']; //full path for the source image
  $config['rotation_angle'] = '180';// 
  
  $this-&gt;load-&gt;library('image_lib',$config);
  
  //Rotate the image
  $this-&gt;image_lib-&gt;rotate();
  </code></pre>