[eluser]splufdaddy[/eluser]
I have an interface that allows users to set a crop area on an image. If they select the whole image, the crop() function doesn't do anything. This is a problem for me because my crop function is set up to perform the crop and save it as a new image, and the new image is not made.
I noticed that a change was made to Image_lib.php from 1.5.4 to 1.6.1 .
This code:
Code:
// If the target width/height match the source then it's pointless to crop, right?
if ($this->width >= $this->orig_width AND $this->height >= $this->orig_height)
{
// We'll return true so the user thinks the process succeeded.
// It'll be our little secret...
return TRUE;
}
was changed to this:
Code:
// 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;
}
Would it make sense to also check before we secretly return true that the config does not specify a new file name ($config['new_image'])?
My workaround right now is to copy the original file to the new destination, and then perform the crop. If a crop happens, then the new file is overwritten. If the user selected 100% to crop, then the crop() does nothing, but the image has already been moved.