Adam Khoury

Donate funds to show love and support

Click the button below to donate funds securely online. You can use your PayPal account or a credit card.

Your donations help free up my time to produce more content and assist in covering server costs. It's also a great way to say thanks for the content!

Application Configuration

Adam will be adding options here soon.

Check GD Library Version and Test Copy Image Rotate

Published :
Author :
Adam Khoury
In this video we learn to write PHP scripts that target GD info array information to see what is installed on our server. We also fire up a few of the functions to test that GD is working by copying an image on the server and rotating it using one of the GD library functions. Script to display your GD library info. <?php $gdInfoArray = gd_info(); $version = $gdInfoArray["GD Version"]; echo "Your GD version is:".$version; echo "<hr />"; foreach ($gdInfoArray as $key => $value) { echo "$key | $value<br />"; } ?> This is the code we used to copy and rotate an image on the server. <?php // Let's target an image, copy it, rotate it, and save it $img = imagecreatefromjpeg("myPic.jpg"); $imgRotated = imagerotate($img, 45, -1); imagejpeg($imgRotated, "myPicRotated.jpg", 100); ?> <img src="myPic.jpg"/><img src="myPicRotated.jpg">