title: Resizing an image on the fly using CodeIgniter
body: <p>I am working on a script that downloads a file from Dropbox, supposed to resize that image and then shoot it up to an S3 bucket.</p>
  
  <p>For some reason, I can't get the image to resize.</p>
  
  <p>I keep getting the following error:<br/>
  <em>The path to the image is not correct.
  Your server does not support the GD function required to process this type of image.</em></p>
  
  <p>Code Base:<br /></p>
  
  <pre><code>public function resize_test() {
              $postcard_assets = $this-&gt;conn-&gt;getPostcardDirContent("folder_name", "Photos", TRUE);
  
              foreach($postcard_assets['contents'] as $asset) {
                  $file = pathinfo($asset['path']);
                  $original_file = $this-&gt;conn-&gt;downloadFile($asset['path']);
  
                  $raw_file = sha1($file['basename']);
                  $s3_file_name = "1_{$raw_file}.{$file['extension']}";
                  $this-&gt;resize_photo($original_file);
                  $this-&gt;s3-&gt;putObject($s3_file_name, $original_file, 's3-bucket-name', 'public-read');
  
                  $s3_check = $this-&gt;s3-&gt;getObjectInfo($s3_file_name, 's3-bucket-name');
  
                  if($s3_check['content-length'] &gt; 0) {
                      krumo($s3_check);
                      exit();
                  }
              }
          }
  
  private function resize_photo($photo) {
              $config['image_library'] = 'imagemagick';
              $config['source_image'] = $photo;
              $config['maintain_ratio'] = TRUE;
              $config['width']     = 640;
              $config['height']   = 480;
  
              $this-&gt;load-&gt;library('image_lib', $config);
  
              if(!$this-&gt;image_lib-&gt;resize()) {
                  exit($this-&gt;image_lib-&gt;display_errors());
              }
          }
  </code></pre>
  
  <p>Dropbox API DownloadFile:<br /></p>
  
  <pre><code>    public function downloadFile($file) {
          $this-&gt;setTokens();
          return $this-&gt;conn-&gt;getFile($file);
      }
  </code></pre>
  
  <p>Anyone know what I might be doing wrong?</p>