Rasmus Vind
Well-known member
I have uploaded a semi-corrupt JPEG file to my installation of XenForo. This gives me the following exception:
I got the exception out by using var_dump() in the catch { } statement in XenForo_Image_Gd.
I Googled around and found that I had to set the following php.ini setting:
This allows gd to move on and emits a warning which XenForo unfortunately interprets as an exception, otherwise I would have gotten the image.
I had to replace (in XenForo_Image_Gd):
with
To actually get my image.
I have attached a .zip of the image and the image too. XenForo.com apparently did not have a problem interpreting the image.
Can you please enlighten me as to what is wrong with my PHP setup? Is it error_reporting? Could you perhaps share copies of your php.ini where this works? Are you using gd?
Code:
ErrorException: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 51 extraneous bytes before marker 0xd9 in /var/www/html/library/XenForo/Image/Gd.php on line 78
I got the exception out by using var_dump() in the catch { } statement in XenForo_Image_Gd.
I Googled around and found that I had to set the following php.ini setting:
Code:
gd.jpeg_ignore_warning = 1
This allows gd to move on and emits a warning which XenForo unfortunately interprets as an exception, otherwise I would have gotten the image.
I had to replace (in XenForo_Image_Gd):
Code:
$image = imagecreatefromjpeg($fileName);
Code:
$image = @imagecreatefromjpeg($fileName);
To actually get my image.
I have attached a .zip of the image and the image too. XenForo.com apparently did not have a problem interpreting the image.
Can you please enlighten me as to what is wrong with my PHP setup? Is it error_reporting? Could you perhaps share copies of your php.ini where this works? Are you using gd?