Page 1 of 1

Dealing with Pictures

Posted: Sun Jun 18, 2006 7:45 am
by Bigun
I started Googling picture functions and all I could read about is the GD library. Problem is that I don't think I have the kind of access required to install the GD library. Therefore, I don't think it would do me a lot of good.

I'm only looking for the ability to detect the size of an dimensions and size of an images, manipulation would be nice if the image falls out of these parameters, but rejection can do for now.

So, can I do these things without the GD library?

Posted: Sun Jun 18, 2006 8:31 am
by tecktalkcm0391
No. Sorry.

What version of PHP do you have?

You can get the GD Library at: http://www.boutell.com/gd/

Posted: Tue Jun 20, 2006 7:23 am
by Bigun
PHP Version 4.4.1 is what the server uses

Posted: Tue Jun 20, 2006 7:26 am
by Bigun
PHP version info wrote:GD Support enabled
Goodie

Posted: Wed Jun 21, 2006 6:59 am
by Bigun
Ok, it seems I can get the picture attributes just by using the getImageSize, and it doesn't seem to use the GD library.

My next question is this:

Is there a way I can prevent users from uploading anything but pictures, or would I have to use some PHP code to detect that it is an image, and reject it if it isn't?

Posted: Wed Jun 21, 2006 9:46 am
by pickle
You can't stop them before they upload non-pictures. You can call getimagesize() on every uploaded file & if you get an error, the file isn't an image.