|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
15 + 40 = ?
Subscribe to this entry?

 [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: Sat Oct 16 22:03:34 2021 UTC