I suppose I don't manage correctly the exception using Imagine libray.
My code is:
use ....
use Imagine\Exception;
....
try {
$imagine = new Imagine();
$image = $imagine->open($img_path . DS . "tmpfile." . $extension)
->resize(new Box($cwidth, $cheight))
->crop(new Point($offsetx, $offsety), new Box(500, 500));
...
} catch (Imagine\Exception\Exception $e) {
die("catch Imagine\Exception\Exception");
$file = new File($img_path . DS . "tmpfile." . $extension);
if ($file->exists()) {
$file->delete();
}
}
but on Imagine Exception, I don't catch it and my script stops.
Where is my mistake?