|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #4346 Suggestion for error trap in imagecreatefromjpeg
Submitted: 2000-05-07 16:29 UTC Modified: 2002-03-22 19:08 UTC
From: leon at leonatkinson dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.1.2 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: leon at leonatkinson dot com
New email:
PHP Version: OS:


 [2000-05-07 16:29 UTC] leon at leonatkinson dot com
Here's a fun bug.  I have a script that loads a JPEG with imagecreatefromjpeg and then sends it directly to the browser.  No error from PHP, and it really was returning a resource, but when I called imagejpeg, it complained about an invalid resource.  It took me about 15 minutes to realize that while the image was there, it had been corrupted by being transfered in ftp's ASCII mode.

I don't know how practical it is because I haven't looked at the code, but it would be nice for imagecreatefromjpeg to return an error when the JPEG is corrupt.  Likewise with the rest of the imagecreatefrom_ family.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-24 07:16 UTC]
Any change on this behaviour?
 [2002-03-22 18:58 UTC] leon at leonatkinson dot com
My suggested functionality definitely works for GIF.  I'm willing to assume it work the same with JPEG, PNG, etc...since they are all using GD, and because I'm too lazy to go recompile. :)
 [2002-03-22 19:08 UTC]
Not our problem, but a GD one.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 07:03:33 2021 UTC