throw ImageException::
forMissingExtension('GD'
); // @codeCoverageIgnore
} } /**
* Handles the rotation of an image resource.
* Doesn't save the image, but replaces the current resource.
*/
protected function _rotate(int
$angle): bool
{ // Create the image handle
$srcImg =
$this->
createImage();
// Set the background color
// This won't work with transparent PNG files so we are
// going to have to figure out how to determine the color
// of the alpha channel in a future release.
$white =
imagecolorallocate($srcImg, 255, 255, 255
);
// Rotate it!
$destImg =
imagerotate($srcImg,
$angle,
$white);