Warning: imagejpeg() [function:imagejpeg]: gd-jpeg: JPEG library reports unrecoverable error

You probably tried to create an image from jpeg that is not jpeg.

I got the same error when I was testing a thumbnail script in PHP.
Then I found that the header of my input file was png although its extension was .jpg.

So, I edited my script so that if there is an error in creating an image from jpeg, it tries to create it from png (or gif if another error occurs).

Leave a Comment