I am trying to rotate an image through GD Library and a database value:
// Image for rotating
$image = 'images/weather-icons/windDir.png';
//degrees from database
$degrees = $row[WindDirDegrees];
// Create the canvas
$source = imagecreatefrompng($image) ;
// Rotate the image
$rotate = imagerotate($source, $degrees, 0) ;
// Outputs
imagepng($rotate) ;
But all I get as output is a huge amount of "gibbergabber" symbols. Does anyone know why?
You are missing header('Content-Type: image/png');