Crop with nothing to do and new image path specified, should copy file |
|||
|---|---|---|---|
| Date: | 08/02/2008 | Severity: | Minor |
| Status: | Duplicate | Reporter: | dmorin |
| Version: | 1.6.3 | ||
| Keywords: | Libraries, Image Manipulation Class | ||
Description
In the image_lib, the crop portion of code checks to see if the image really needs to be cropped and if not, returns true. However, if a new image path is specified, further user code is probably counting on that new image existing.
The easy solution would be to just copy the old image to the new image path and then return true. This is happening for actions other than crop, so adding should be trivial.
Code Sample
// If the target width/height match the source then it's pointless to crop, right?
// So if dynamic output isn't on, then we'll return true so the user thinks
// the process succeeded. It'll be our little secret...
if ($this->width >= $this->orig_width AND $this->height >= $this->orig_height AND $this->dynamic_output !== TRUE)
{
return TRUE;
}
Expected Result
Actual Result
Comment on Bug Report
| Posted by: dmorin on 2 August 2008 7:10pm | |
|
|
Not sure if this is related or if the author was just looking for more magic than he got: http://codeigniter.com/bug_tracker/bug/4759/ |
| Posted by: onejaguar on 22 September 2008 6:01pm | |
|
|
Duplicate of #4532 |
