So I have png image and I rotate it but i get a black background.. or if i do the color code ofr white i get white.. I tried doing this..
$trans = imagecol
$info = pathinfo($pathToImage);
$name = str_replace("." . $info['extension'], "", $info['basename']);
$size = getimagesize($pathToImage);
$type = isset($size['type']) ? $size['type'] : $size[2];
// Check support of file type
if (!(imagetypes() & $type)) {
// Server does not support file type
return false;
}
$source = self::imageCreateFrom($pathToImage, trim($info['extension'])) or notfound();
$transColor = imagecolorallocatealpha($source, 255, 255, 255, 127);
// $transparency = imagecolorallocatealpha($source, 0, 0, 0, 127);
$rotate = imagerotate($source, 360 - $rotate_angle, $transColor);
//imagealphablending($rotate, false);
imagesavealpha($rotate, TRUE);
//imagejpeg($rotate,$pathToThumbs.DIRECTORY_SEPARATOR.$info['basename']);
self::createImage($rotate, $pathToThumbs, $info['basename'], trim($info['extension']));
// imagejpeg($rotate);
imagedestroy($source);
imagedestroy($rotate);