title: Codeigniter image manipulation output black
body: <p>I am getting a black area to handle this with CI, the image have 950x720</p>
  
  <p>the first resize is ok
      $this->resize($data['upload_data']['full_path'], 220, 200, true, false);
  but in the second, the error appear</p>
  
  <p>code on gist:
  <a href="https://gist.github.com/mateuspv/48ba464a557da9bbdf10" rel="nofollow noreferrer">https://gist.github.com/mateuspv/48ba464a557da9bbdf10</a></p>
  
  <p><img src="https://i.stack.imgur.com/dTn0u.jpg" alt="ci black error"></p>
  
  <pre><code>&lt;?php
  /**
   * resize
   * @param  string $path   [description]
   * @param  int $width  [description]
   * @param  int $height [description]
   * @param  boolean $thumb  [description]
   * @param  boolean $ratio  [description]
   */
  private function resize($path, $width, $height, $thumb, $ratio) {
          $config['image_library'] = 'GD2';
          $config['source_image'] = $path;
          $config['maintain_ratio'] = $ratio;
          $config['create_thumb'] = $thumb;
          $config['encrypt_name'] = TRUE;
          $config['width'] = $width;
          $config['height'] = $height;
          $this-&gt;image_lib-&gt;clear();
          $this-&gt;image_lib-&gt;initialize($config);
          $this-&gt;image_lib-&gt;resize();
          if (!$this-&gt;image_lib-&gt;resize()) {
              die($this-&gt;image_lib-&gt;display_errors());
  
          }
      }
  
  //...
  
  /**
   * TODO ~
   */
  $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
  $this-&gt;resize($data['upload_data']['full_path'], 220, 200, true, false);
  $this-&gt;resize($data['upload_data']['full_path'], 450, 450, false, false);
  </code></pre>