Welcome to WebmasterWorld Guest from 54.167.177.207

Forum Moderators: coopster & jatar k

Capturing Image Properties

   
8:48 pm on Aug 25, 2006 (gmt 0)

5+ Year Member



Could someone please tell me how I can capture the height and width of an image and insert the values into variables?

Thank you.

8:58 pm on Aug 25, 2006 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member




$image = "image.jpg";
$info = [url=http://us3.php.net/manual/en/function.getimagesize.php]getimageinfo[/url]($image);
$width = $info[0];
$height = $info[1];

You can also use other methods. Good luck!

9:07 pm on Aug 25, 2006 (gmt 0)

5+ Year Member



Sweet..thank you.
3:52 am on Aug 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have the image loaded in memory, you can use imageSX($img) and imageSY($img).
6:50 am on Aug 26, 2006 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



And just so there is no confusion:

$info = getimageinfo($image);

Should be:

$info = getimagesize($image);

dc

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month