al3x8730 Posted September 15, 2008 Share Posted September 15, 2008 So anyways I was making a dynamic image to display some of my website's stats that I can then display on my forum signature somewhere. I got it working, then I noticed that it wouldn't work since it was a .php extension the image, so I used .htaccess to fix this. Then I tried again and it said that it couldn't determine the dimensions of the image. I believe this: http://us2.php.net/getimagesize will be able to help, if so can you show me the right way to use it, if not, then say so. How do I use this function, I found the tutorial, but I need help x.x EDIT: Merged by wildteen88 Quote Link to comment https://forums.phpfreaks.com/topic/124370-getimagesize/ Share on other sites More sharing options...
wildteen88 Posted September 15, 2008 Share Posted September 15, 2008 getimagesize returns an array which holds the width and height of the image referenced, eg echo '<pre>' . print_r(getimagesize('path/to/image.jpg'), true) . '</pre>'; Quote Link to comment https://forums.phpfreaks.com/topic/124370-getimagesize/#findComment-642298 Share on other sites More sharing options...
waynew Posted September 15, 2008 Share Posted September 15, 2008 $sizes = getimagesize("images/image.jpg"); $width = $sizes[0]; $height = $sizes[1]; Quote Link to comment https://forums.phpfreaks.com/topic/124370-getimagesize/#findComment-642335 Share on other sites More sharing options...
DarkWater Posted September 16, 2008 Share Posted September 16, 2008 @waynewex: You can shorten that to: <?php list($width, $height) = getimagesize("images/image.jpg"); Quote Link to comment https://forums.phpfreaks.com/topic/124370-getimagesize/#findComment-642416 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.