homepage Welcome to WebmasterWorld Guest from 107.21.187.131
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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




msg:3060724
 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




msg:3060736
 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




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

Sweet..thank you.

FourDegreez




msg:3061033
 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




msg:3061109
 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