1
私はコントローラbase64で画像を入力しています。画像のサイズを変更するには介在画像を使用しています。画像を保存します。 PostController.php線163にLaravel 5.2 - 介入画像、base64入力画像を保存
ErrorException:BASE64_DECODE()は パラメータ1が
public function creaPost(Request $request){
$image_array = $request->input('image'); // input image base64
$contare = count($image_array);
for($i = 0; $i < $contare; $i++) {
$file = base64_decode($image_array[$i]);
if (!empty($file)) {
$background = Image::canvas(550, 550);
$image2 = Image::make($file)->encode('jpg', 100)- >resize(550, 550, function ($c) {
$c->aspectRatio();
$c->upsize();
});
... my code...etc..
$store_path->save();
}
}
}
ライン$file = base64_decode($image_array[$i]);
リターンを与えられた文字列、アレイであることを期待し、私は、デコード画像BASE64といくつかの問題を抱えていますエラー、私はどのように私はよく私の配列の画像をデコードすることができますかわからない。
私がしなければMAYBE を助けることができる:
$image_array = $request->input('image');
return dd($image_array[1]);