0
我需要调整上传的图像大小并将其保存为给定分辨率。假设用户只上传一张图片,并在完成上传后保存为35x35,100x100和512x512。最后他的一次上传保存在我的文件夹中,作为3张不同分辨率的图像我已经完成了使用laravel这一点...使用php调整上传的图像
public function postSingleUpload()
{
//create the relevant directory to add the user image
//get the directory name (directory name equals to user id)
$dirPath = sprintf("images/users/avatar/%s/", Auth::user()->id);
//create the directory named by user id
if (!file_exists($dirPath)) {
mkdir($dirPath, 0700);
}
$file = Input::file('image');
//save image with given resulutions
//---- this part i need --------//
}
所以请帮助我这个。
http://www.white-hat-web-design.co.uk/blog/resizing -images-with-php/ – JMc 2014-11-24 20:37:49
我使用包装干涉/图像。节省时间,效果很好。在packagist.org上获取它。 – Robbie 2014-11-24 20:45:49