<p>I am having some trouble manipulating images using CodeIgniter 1.7.  With the following code, the image is uploaded correctly. Alas, instead of a new image being made, and then modified; the existing image is modified. Any help?</p>

<pre><code>//Upload image first
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|bmp';

$this-&gt;load-&gt;library('upload', $config);        
$this-&gt;upload-&gt;do_upload();

//Now fix the image
$picloc = $this-&gt;upload-&gt;data();
$picloc = $picloc['file_name'];

$thumbnail = "thumb_".$picloc;

$imagemanip['image_library'] = 'gd2';
$imagemanip['source_image'] = './uploads/'.$picloc;
$imagemanip['new_img'] = './uploads/'.$thumbnail;
$imagemanip['maintain_ratio'] = TRUE;
$imagemanip['width'] = 250;
$imagemanip['height'] = 250;

$this-&gt;load-&gt;library('image_lib', $imagemanip);

$this-&gt;image_lib-&gt;resize();
</code></pre>

The problem is simple, you have a typo in the line:
```
```
$imagemanip['new_img'] = './uploads/'.$thumbnail;
```
```
The the index should be "new_image", not "new_img", so the line becomes..
```
```
$imagemanip['new_image'] = './uploads/'.$thumbnail;
```
```