imagecreatefromjpeg quitting out on me

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Noir
Forum Newbie
Posts: 2
Joined: Sat Jan 03, 2004 10:14 pm

imagecreatefromjpeg quitting out on me

Post 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.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post 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
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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... ;)
Last edited by JAM on Sun Jan 04, 2004 11:11 am, edited 1 time in total.
Noir
Forum Newbie
Posts: 2
Joined: Sat Jan 03, 2004 10:14 pm

Ah!

Post 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.
Post Reply