ID: 39918 User updated by: hnthanhphong at yahoo dot com Reported By: hnthanhphong at yahoo dot com Status: Bogus Bug Type: GD related Operating System: Linux PHP Version: 5.2.0 Assigned To: pajoye New Comment:
ini_set("gd.jpeg_ignore_warning", 1); This code is useful. Now I can make sure that my page always works. Thanks you for your help. Previous Comments: ------------------------------------------------------------------------ [2006-12-21 12:12:27] [EMAIL PROTECTED] GD does provide a mechanism to be more tolerant with broken jpeg images. Using error_reporting(E_ALL); while developing would have told you what's going on. GD did report some errors in the jpeg codec. Some of the jpeg errors are recoverable, like those in this image. You can change the behaviors of the jpeg codec using gd.jpeg_ignore_warning: ini_set("gd.jpeg_ignore_warning", 1); $im = imagecreatefromjpeg("test.jpeg"); $im contains now your image. ------------------------------------------------------------------------ [2006-12-21 09:49:15] hnthanhphong at yahoo dot com I re-saved in Photoshop, and post again it works property. Thank you very much. ------------------------------------------------------------------------ [2006-12-21 09:43:53] [EMAIL PROTECTED] Photoshop also "repairs" broken JPEGs, PHP does not do that, and will never do that. I bet if you re-save it in Photoshop PHP can read it as well. ------------------------------------------------------------------------ [2006-12-21 09:26:22] hnthanhphong at yahoo dot com But I open this file in photoshop. It works no problem. ------------------------------------------------------------------------ [2006-12-21 09:23:56] [EMAIL PROTECTED] The messages already says it: Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'C:\ModelMayhem\Source/userphotos/8_48_R.JPG' is not a valid JPEG file ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39918 -- Edit this bug report at http://bugs.php.net/?id=39918&edit=1