Welcome to WebmasterWorld Guest from 54.144.77.26

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Capturing Image Properties

     

SEOcritique

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.

eelixduppy

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!

SEOcritique

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

5+ Year Member



Sweet..thank you.

FourDegreez

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).

dreamcatcher

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