Pedro Chagas
asked on
Get image resolution when upload image
Hi, I create a control panel for my client change some parts of his site, and one thing he can do, is upload image.
But is not all images, just images that width < height.
I need help to know how I check the resolution of image, before I safe in respective folder.
I know get 3 things of each image, name, size in bytes, and the type:
=============
$filename = $_FILES['uploadfile']['nam e'];
$filesize = $_FILES['uploadfile']['siz e'];
$filetype = $_FILES['uploadfile']['typ e'];
===================
I need to know because if height < width the script don't continue.....
Have a way to know the resolution of image before I save the image in folder and in data base?
Regards,
JC
But is not all images, just images that width < height.
I need help to know how I check the resolution of image, before I safe in respective folder.
I know get 3 things of each image, name, size in bytes, and the type:
=============
$filename = $_FILES['uploadfile']['nam
$filesize = $_FILES['uploadfile']['siz
$filetype = $_FILES['uploadfile']['typ
===================
I need to know because if height < width the script don't continue.....
Have a way to know the resolution of image before I save the image in folder and in data base?
Regards,
JC
ASKER
I use getimagesize like Michael701 said, but I get this warning:
Warning: getimagesize(PA273896.JPG) [function.getimagesize]: failed to open stream: No such file or directory in /home/luis/public_html/pre /painel_co ntrole/pai nel_nivel1 _imagem_up load.php on line 69
How I resolve this problem?
Warning: getimagesize(PA273896.JPG)
How I resolve this problem?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just change "$_FILES['userfile']['tmp_ name']" to "$_FILES['uploadfile']['tm p_name']"
getimagesize($_FILES['uplo
more info at
http://us2.php.net/manual/en/function.getimagesize.php