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