I have a simple script:
<?php
$source = '../path/img.jpg';
$image = imagecreatefromjpeg($source);
?>
Finally I got:
Fatal error: valid memory size 134217728 Bytes exhausted
But when I try to do something like this:
<?php
$source = '../path/img.jpg';
$image = @imagecreatefromjpeg($source);
if ( !$image )
{
die('Image file is too large');
}
?>
but that will not work. Fatal error stops my script. Is there any way to change this? I would like to know when a fatal error exists (then I got FALSE as $ image), and then I would like to stop the script, but first I want to print information about it.
Thank.
source
share