image_lib crop() doesn’t create new file when source_img!=new_image |
|||
|---|---|---|---|
| Date: | 05/14/2008 | Severity: | Minor |
| Status: | New | Reporter: | onejaguar |
| Version: | 1.6.3 SVN | ||
| Keywords: | Libraries, Image Manipulation Class | ||
Description
If I ask to resize an image, specifying a new file name, but set the width and height to the current width and height of the image, image_lib does a file copy.
On the contrary if I ask to crop an image, specifying a new file name, but set the width and height to the current width and height of the image, image_lib does nothing and returns TRUE.
crop() should copy the file like resize() does.
Code Sample
$config['source_image'] = '/tmp/100x100.jpg";
$config['new_image'] = '/tmp/new.jpg";
$config['x_axis'] = 0;
$config['y_axis'] = 0;
$config['width'] = 100;
$config['height'] = 100;
$this->image_lib->initialize($config);
$this->image_lib->crop();
echo file_exists($config['new_image']);
Expected Result
TRUE
Actual Result
FALSE
