I have a website where the public can upload JPEG files.
Someone from the public uploaded an invalid JPEG, because of which the site crashed into them.
PHP said ...
imagecreatefromjpeg () [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: error being restored: premature end of JPEG file
I was not sure how to get around this, so I googled and found this site . He told me to add ...
ini_set('gd.jpeg_ignore_warning', 1);
I added that in my index.php (loading my site, where I do other ini_set() ).
This does not seem to fix it.
How can I handle this invalid jpeg case? Am I doing something with the INI kit? I am on a shared host, so I cannot directly modify php.ini .
I use Kohana 2.3 and its Image Library , but I do not think this is really relevant here.
thanks
php error-handling gd
alex
source share