This function works perfectly when defining the rotation degrees in text such as "-90" but when I try to us the degrees parameter as a $variable the image does not rotate. Any ideas? thanks in advance.
function compress_image($source_url, $destination_url, $quality) {
$info = getimagesize($source_url);
if ($info['mime'] == 'image/jpeg')
$image = imagecreatefromjpeg($source_url);
elseif ($info['mime'] == 'image/gif')
$image = imagecreatefromgif($source_url);
elseif ($info['mime'] == 'image/png')
$image = imagecreatefrompng($source_url);
$rotate = imagerotate($image,"-90",0); //Does Work
$degrees = "-90"
$rotate = imagerotate($image,$degrees,0); //Does Not Work
$image = $rotate;
imagejpeg($image, $destination_url, $quality);
return $destination_url;
}