Master PHP Image Processing with Adam Khoury in this Video Textbook Series. 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.
<?php
// Display your GD library info
$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 used when we copied and rotated an image -->
<?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"/>