|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31726 GD -JPEG-JFIF error
Submitted: 2005-01-27 17:37 UTC Modified: 2005-02-01 10:05 UTC
From: skyfox at isp dot ee Assigned:
Status: Not a bug Package: *Graphics related
PHP Version: 4.3.10 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: skyfox at isp dot ee
New email:
PHP Version: OS:


 [2005-01-27 17:37 UTC] skyfox at isp dot ee
PHP Version 4.3.10
GD Support  enabled  
GD Version  bundled (2.0.28 compatible)  
FreeType Support  enabled  
FreeType Linkage  with freetype  
GIF Read Support  enabled  
GIF Create Support  enabled  
JPG Support  enabled  
PNG Support  enabled  
WBMP Support  enabled  
XBM Support  enabled  

Expected result:
but any jpeg(JFIF) make error:
Warning: imagecreatefromjpeg(): '/var/www/upload/60125' is not a valid
JPEG file in /var/www/amur/photo_new.php on line 39

Warning: imagesx(): supplied argument is not a valid Image resource in
/var/www/amur/photo_new.php on line 40

Warning: imagesy(): supplied argument is not a valid Image resource in
/var/www/amur/photo_new.php on line 41


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-27 17:41 UTC]
Please supply the image in question.
 [2005-01-28 08:33 UTC] skyfox at isp dot ee
 [2005-01-28 08:43 UTC] skyfox at isp dot ee
 [2005-01-28 21:49 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Have you tried to look at these images yourself?
60125 is definitely broken as even my viewer refuses to show it up correctly - only a half of the image is viewable.
 [2005-01-31 11:19 UTC] skyfox at isp dot ee
this is not BROKEN PHOTO!
 [2005-01-31 11:25 UTC]
When opening it in GIMP I get the following error:

Corrupt JPEG data: 145 extraneous bytes before marked 0xd9

EXIF data will be ignored.
 [2005-01-31 16:37 UTC] skyfox at isp dot ee
Derick - try it by IE ;) no errors
 [2005-02-01 09:28 UTC]
We do not want to support broken images. Even if a broken IE can load them, accepting invalid images/data as valid data is the best to run in troubles.

 [2005-02-01 09:38 UTC] skyfox at isp dot ee
then verify broken upload photo not work!

this is from my code:
  if ($_FILES["photo"]["error"]==UPLOAD_ERR_NO_FILE) {return($lns[49]);}
  if ($_FILES["photo"]["error"]==UPLOAD_ERR_PARTIAL) {return($lns[50]);}
  if (($_FILES["photo"]["error"]==UPLOAD_ERR_INI_SIZE)
     ||($_FILES["photo"]["error"]==UPLOAD_ERR_FORM_SIZE)) {return($lns[51]);}
  if ($_FILES["photo"]["error"]<>UPLOAD_ERR_OK){return('Error:'.$_FILES["photo"]["error"]);}
 [2005-02-01 10:05 UTC]
Please stop to comment this bug. Your images are not valid. Fix them or ask your clients to fix them.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 01:01:29 2024 UTC