[2006-12-21 09:23 UTC] [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
[2006-12-21 09:26 UTC] hnthanhphong at yahoo dot com
But I open this file in photoshop. It works no problem.
[2006-12-21 09:43 UTC] [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:49 UTC] hnthanhphong at yahoo dot com
I re-saved in Photoshop, and post again it works property. Thank you very much.
[2006-12-21 12:12 UTC] [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.
Bookmarks