homepage Welcome to WebmasterWorld Guest from 54.234.0.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Capturing Image Properties
SEOcritique

5+ Year Member



 
Msg#: 3060722 posted 8:48 pm on Aug 25, 2006 (gmt 0)

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

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



 
Msg#: 3060722 posted 8:58 pm on Aug 25, 2006 (gmt 0)


$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

5+ Year Member



 
Msg#: 3060722 posted 9:07 pm on Aug 25, 2006 (gmt 0)

Sweet..thank you.

FourDegreez

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3060722 posted 3:52 am on Aug 26, 2006 (gmt 0)

If you have the image loaded in memory, you can use imageSX($img) and imageSY($img).

dreamcatcher

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



 
Msg#: 3060722 posted 6:50 am on Aug 26, 2006 (gmt 0)

And just so there is no confusion:

$info = getimageinfo($image);

Should be:

$info = getimagesize($image);

dc

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved