View Full Version : checking file image dimentions
HormonX
10-31-2002, 04:30 PM
i would like to check the dimmentions of a image that's being uploaded. So far i was able to use $userfile_name and $userfile_size. Is there somtheing like $userfile_width and $userfile_height that i can use to chech the dimmentions of the file ?
thanx
HormonX
Nightfire
10-31-2002, 04:58 PM
$image_info = getimagesize("images/image.gif");
echo "$image_info[0] - width<br>";
echo "$image_info[1] - height";
no - you would need to move the image and then use
$siz = GetImageSize('my_folder/my_image.jpg');
You might just be able to do it by referencing the temp name while it is in the /tmp/ folder (seem to remember you cannot though).
The above would return an indexed array
$siz[0] = width
$siz[1] = height
$size[2] = type
$siz[3] = string 'width="xx" height="yy"';
from memory so indexes might be wrong - 1 and 2 are right tho.
:boo hiss: pipped at the post by Nightfire.
I meant index[0] and [1] are correct btw.
Nightfire
10-31-2002, 05:03 PM
:p hehe
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.