php旋转并保存图像-什么都不做?
作者:互联网
我正在尝试使用以下代码旋转和保存图像,但是它似乎没有做任何事情,也不吐出任何错误?
这是我的代码:
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.我似乎无法弄清楚为什么它不起作用?
解决方法:
旋转一下:(已测试)
<?php
$path = '/Volumes/yoda/websites/zepel.website.2013/images/blog/display';
$file = '10.jpg';
$degrees = 90;
header('Content-type: image/jpeg');
$filename = $path . "/" .$file;
$source = imagecreatefromjpeg($filename) or notfound();
$rotate = imagerotate($source,$degrees,0);
imagejpeg($rotate);
imagedestroy($source);
imagedestroy($rotate);
?>
标签:image,image-rotation,php 来源: https://codeday.me/bug/20191030/1970602.html