images

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
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

images

Post by phpScott »

Is there a way to check the height and width of a uploaded pictures or even if the picture is already on the server to check the height and width is?
ie I want to be able to reject pictures that don't meet a min, or max hieght and width.

phpScott
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

nermind

Post by phpScott »

Sorry guys nevermind I found my answer.
Thanks
:oops:
phpScott
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Just out of curiosity how are you doing it?

I'm currently using..

Code: Select all

<?php

$image_info=getimagesize("path the to image");

$image_width=$image_info[0];
$image_height=$image_info[1];


?>
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

that's it

Post by phpScott »

That is exactly what I am using. I did a search on the php.net site and found a whole lot of image functions and stumbled across getimagesize().
I was just being a little lazy in posting the question instead of doing the research.

phpScott
Post Reply