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

php, wordpress

Solution

1) Check the space in disk

Your system must have enough disk space

2) Check the memory limit

Set more memory in your php:

ini_set("memory_limit","256M");

3) Check the post_max_size and upload_max_filesize

Set more in your htaccess file:

php_value post_max_size 16M
php_value upload_max_filesize 6M

4) put @ in front of the function

@imagejpeg(..............);

Point 1) worked for me.

Problem

I have wordpress installation on my root folder, until yesterday it was working fine, but today it gives following error for i guess generating thumbnail images, ``` Warning: imagejpeg() [function:imagejpeg]: gd-jpeg: JPEG library reports unrecoverable error: in public_html/wp-includes/media.php on line 459 ``` do anyone have any idea regarding this warning?? Please help me following code is on line 459 ``` if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) ```

Original source