title: Multiple thumbnails at once in CodeIgniter
body: <p>At the moment at once I'm learning and trying, to what CodeIgniter is able to. But I stuck at multiple thumbnails making at once. Probably, I messed up my head too much using Wordpress, and trying to do something like this in Codeigniter, but anyways, here is my code</p>
  
  <pre><code>&lt;?php
  
  class Gallery_model extends CI_Model {
  
  var $gallery_path;
  
  function __construct() {
      parent::__construct();
      $this-&gt;load-&gt;helper('functions');
      $this-&gt;gallery_path = realpath(APPPATH . '../uploads');
  }
  
  function do_upload() {
  
      $config = array(
          'allowed_types' =&gt; 'jpg|jpeg|gif|png',
          'upload_path' =&gt; $this-&gt;gallery_path,
          'max_size' =&gt; 2000
      );
  
      $this-&gt;load-&gt;library('upload', $config);
      $this-&gt;upload-&gt;do_upload();
      $image_data = $this-&gt;upload-&gt;data();
  
  
      $image_sizes = array(
          'thumb' =&gt; array(150, 100),
          'medium' =&gt; array(300, 300),
          'large' =&gt; array(800, 600)
      );
  
      foreach ($image_sizes as $resize) {
  
          $config = array(
              'source_image' =&gt; $image_data['full_path'],
              'new_image' =&gt; $this-&gt;gallery_path . '-' . $resize[0] . 'x' . $resize[1],
              'maintain_ration' =&gt; true,
              'width' =&gt; $resize[0],
              'height' =&gt; $resize[1]
          );
  
          $this-&gt;load-&gt;library('image_lib', $config);
          $this-&gt;image_lib-&gt;resize();
      }
  }
  }
  </code></pre>
  
  <p>At the moment, I'm able to create just an image it self, but I cant make thumbnails with this. Maybe someone could enhance the code, and get it work :)</p>
  
  <p>PS - I tried just take everything after $image_sizes, put it in other independent php file, run it, and var dump the $config inside of foreach, and it seemed like working.</p>