Page 1 of 1

PHP crashes on imagecreatefromjpeg()

Posted: Tue Aug 08, 2006 6:47 am
by abdabs
I have a picture upload script that runs smoothly, untill I tried uploading jpeg from my digital camera. The same problem also happend for my friends camera picture too, too different brands. I'am not quite sure what model it was, but Olympus defently. (I lost my camera...)

Size is not a matter, done some testes on that.. and my upload limits in php.ini is far beyond the pictures size.

The script crashes on imagecreatefromjpeg(), I've no idea how to fix it.. I read some comments on the issue at http://php.net/imagecreatefromjpeg , something about the image is not fully build. But that didn't help me out..

Code: Select all

$im = imagecreatefromjpeg($_FILES['upload_pic']['tmp_name']);
There is a program called: jhead that might solve the problem, but unfortnatly I don't the possibility to install it:
jhead: http://www.sentex.net/~mwandel/jhead/

Is there anything I can do, to fix this problem? So that I can upload my cameras jpeg's too..

Thanks.


PHP version: PHP Version 4.4.0-pl1-gentoo
GD: bundled (2.0.28 compatible)

Posted: Tue Aug 08, 2006 8:49 am
by php3ch0
correctme if i'm being stupid here but...

If this is a large file to be uploaded from a jpeg. Will php timeout after 30 seconds and fail the upload?

Posted: Tue Aug 08, 2006 9:13 am
by feyd
knowing the specific error message you are getting would help to direct you to a solution.

RE

Posted: Tue Aug 08, 2006 9:25 am
by abdabs
Nope, there are now time up problem.. have set that to large number, and tested for "working jpegs" that are > 1MB.

I don't get any error messages, because php just freeze out/crashes.. I tested the script, by moving a: die("I got this far"); and found out that imagecreatefromjpeg stopped the script with these strange jpegs.

But is there any other way I wan print error message for this case?

Is there alternatives to imagecreatefromjpeg() that does the same thing?