How do we know GD library is present or not?
create a php file with this coding
phpinfo()
then look down the screen till you see a section named gd.
If this is there, then GD is present on your server.
If checking manually with phpinfo() is not feasible, you can use [man]gd_info/man. I have never tried it on a PHP installation that did not have GD installed, but my guess is that it either returns some empty array if GD is not installed, or does not exist at all. For the latter, you can then use [man]function_exists/man to determine if there is GD support.
if(extension_loaded('gd')) { echo 'You have GD!'; } else { echo 'You don\'t have GD! :('; }