Share on Google+Share on Google+

PHP GD get image dimensions

This example shows how to get dimensions of image in php gd.


if($img = @GetImageSize("images.jpg"))


echo "image exists , here is some info<br>";

echo "width = $img[0]<br>";

echo "height = $img[1]<br>";




echo"image does not exist";



After running the program you will get the following output

OUTPUT :image exists , here is some info width = 143 height = 136



Posted on: November 11, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null