【发布时间】:2013-06-11 03:31:29
【问题描述】:
我正在尝试使用以下代码来旋转和保存图像,但它似乎没有做任何事情,也没有吐出任何错误?
这是我的代码:
header('Content-type: image/jpeg');
$path = '/Volumes/yoda/websites/zepel.website.2013/images/blog/display';
$file = '10.jpg';
$degrees = 90;
$filename = $path."/".$file;
$source = imagecreatefromjpeg($filename) or notfound();
$rotate = imagerotate($source,$degrees,0);
imagejpeg($filename,$rotate);
imagedestroy($source);
imagedestroy($rotate);
任何帮助将不胜感激。我的图像文件夹也设置为 777。我似乎无法弄清楚为什么它不起作用?
【问题讨论】:
-
header('Content-type: image/jpeg');的位置很重要。在下面尝试我的答案,经过测试并且可以正常工作。
标签: php image image-rotation