0

我正在尝试通过 GD 库和数据库值旋转图像:

// 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) ;

但我得到的输出只是大量的“gibbergabber”符号。有谁知道为什么?

4

1 回答 1

0

你不见了header('Content-Type: image/png');

见:http ://www.php.net/manual/en/function.imagepng.php

于 2014-02-05T22:37:43.463 回答