Today I encountered GD’s resizeimage function when processing thumbnails of jpg suffix files, prompting this image It is not a legal jpg image and an error will be reported
<b>Warning</b>: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG
I searched a lot of information on the domestic Internet but could not find an effective solution. It turns out that the solution can be solved by opening the GD jpeg file
ini_set('gd.jpeg_ignore_warning', true);
Write the above line of code at the beginning or open this configuration in the php.ini file
The above content is an analysis and solution for the failure to generate thumbnails for some jpg files in php resizeimage. I hope it will be helpful to everyone!