你好我retriving圖像的base64編碼版本和我有通過將其裁剪到小尺寸存儲它。現在我不能夠裁切圖像,請幫我 我的代碼如下.. 請幫我在種植基地64圖像轉換圖像64×64像素在PHP BASE64解碼圖像之後
$data = str_replace('data:image/png;base64,', '', $note['file']);
$data = str_replace(' ', '+', $data);
$decodedFile = base64_decode($data);
$file = fopen($destination , 'wb');
if(!fwrite($file, $decodedFile)){
//return("ERROR: can't save file to $destination");
return '-1';
}
fclose($file);
嘗試使用$ success = file_put_contents($ destination,$ decodedFile); – Saty
影像是否正確上傳,但我必須裁剪64圖像* 64 – Deepesh
因此搜索「調整圖像的PHP」或「裁剪圖像PHP」比寫一個問題更困難? –