Page 1 of 1

imagecreatefromjpeg quitting out on me

Posted: Sat Jan 03, 2004 10:14 pm
by Noir
I'm trying to put together a program to make thumbnails for all files in a directory. Along the way, I'm running the function imagecreatefromjpeg to try to open up the jpeg so that I can do stuff with it, but it when I try to run imagecreatefromjpeg, the program just quits. Why?

BTW: At first, when I tried to run imagecreatefromjpeg, I was getting an error message that the function did not exist.

Then, after examining php.net a bit more, I added an @ in front of imagecreatefromjpeg, and now I'm not getting an error message, but, as I said, the program quits when I try to run the function.

Posted: Sat Jan 03, 2004 11:32 pm
by DuFF
My guess is that you do not have GD installed on your server. Go here for more info:
http://www.boutell.com/gd/
http://www.boutell.com/gd/faq.html

Posted: Sun Jan 04, 2004 6:14 am
by JAM
Adding a @ in front of a function just supresses any error-messages it might give. So if you are missing an install of GD (as DuFF mentioned) you wouldn't know of it.

Supressing function-errors it's like giving headache pills to someone with meningitis. You take away the pain temporarily, but you don't cure it.

Never count on it to solve any problems... ;)

Ah!

Posted: Sun Jan 04, 2004 8:31 am
by Noir
JAM - Thank you, I did not know that's what @ did. I just did it because the script on php.net seemed to have it like that for some reason.

DuFF - Thank you to yourself as well. There *was* GD installed, but it was 1.6.2, and thusly, horribly outdated... once GD was updated, things worked *MUCH* better. That was the problem.