Page 1 of 1
check picture size(dimensions)
Posted: Fri Jan 02, 2004 9:39 am
by lizlazloz
hi, i'm making a kind of profile area for my site, and i'm allowing the user to have a profile picture which they link to from another site.
is there anyway for me to automatically check the dimensions of the picture before it is chosen, say that it is under 400x400 pixels?
Posted: Fri Jan 02, 2004 9:41 am
by JAM
Use getimage(). The result it generates is an array with width and height that you can use later to check against.
Posted: Fri Jan 02, 2004 10:30 am
by itsmani1
getimagesize()
getimagesize -- Get the size of an image
Description
array getimagesize ( string filename [, array imageinfo])
The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMP image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag.
You just get the imagesize and then check weather it is acceptable to the size that you have Standardized or not if yes then use it else leave a message that "Change the size of image"
Posted: Fri Jan 02, 2004 10:30 am
by itsmani1