I have a simple script:
<?php
$source = '../path/img.jpg';
$image = imagecreatefromjpeg($source);
?>
Finally I got:
Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted
But when I try do something like that:
<?php
$source = '../path/img.jpg';
$image = @imagecreatefromjpeg($source); // Mute Fatal Error
if ( !$image )
{
die('Image file is too large');
}
?>
but it doesn't work. Fatal error is stopping my script. Is any way to change this situation? I would like to know when fatal error is exist (then i got FALSE as $image) and then I would like to stop script, but first I want to print an information about it.
Thanks.