Page 1 of 1

get image width and height

Posted: Fri Mar 25, 2005 6:31 pm
by psychotomus
how can i get a images width and height?

Posted: Fri Mar 25, 2005 6:34 pm
by method_man

Code: Select all

<html>
<body>

<p>
<img src=&quote;blah.gif&quote;
width=&quote;20&quote; height=&quote;20&quote;>
</p>

<p>
<img src=&quote;blah.gif&quote;
width=&quote;45&quote; height=&quote;45&quote;>
</p>

<p>
<img src=&quote;blah.gif&quote;
width=&quote;70&quote; height=&quote;70&quote;>
</p>

//You can make a picture larger or smaller changing the values in the &quote;height&quote; and &quote;width&quote; attributes of the
img tag.//

</body>
</html>
I think this is what you are talking about :D

matt

Posted: Fri Mar 25, 2005 6:39 pm
by John Cartwright
I think he needs

http://ca3.php.net/manual/en/function.getimagesize.php

Code: Select all

$info = getimagesize($image);

//info now contains the dimenisions of the image
echo '<pre>'.print_r($info).'</pre>';