image icon indicating copy to clipboard operation
image copied to clipboard

Intervention \ Image \ Exception \ NotReadableException Image source not readable

Open jcastillovnz opened this issue 6 years ago • 3 comments

Hola amigos tengo el siguiente error al guardar una imagen en laravel con intervention image, alguna solucion? Hello friends I have the following error when saving an image in laravel with the image of the intervention, the solution of the solution?

public function storage (Request $request) { # carga de fotografias

$file = $request->file('lugarsiniestro'); $fileName = time() . '-' . $file->getClientOriginalName(); $file->move('uploads', $fileName);

$img = Image::make($file->getRealPath()) ->resize(300, 240) ->save('public/uploads/', $file->getClientOriginalName());

}

jcastillovnz avatar Jul 20 '18 17:07 jcastillovnz

Oh, I have the same problem as you. That images url is very long and have other code, I don't know if this is the reason.

vioulo avatar Mar 26 '19 08:03 vioulo

Hola amigos tengo el siguiente error al guardar una imagen en laravel con intervention image, alguna solucion? Hello friends I have the following error when saving an image in laravel with the image of the intervention, the solution of the solution?

public function storage (Request $request) {

carga de fotografias

$file = $request->file('lugarsiniestro'); $fileName = time() . '-' . $file->getClientOriginalName(); $file->move('uploads', $fileName);

$img = Image::make($file->getRealPath()) ->resize(300, 240) ->save('public/uploads/', $file->getClientOriginalName());

}

heeeee, I just found out the reason for this problem, I don't know if it is similar to your situation. When the images url have chinese string, that error will appear

vioulo avatar Mar 27 '19 09:03 vioulo

Replace

$resize = Image::make('storage/app/public/'.$user->image)->resize(300,300);

with

$resize = Image::make(storage_path('app/public/'.$user->image))->resize(300,300);

Give storage full path will solve the problem.

meghasethi7861 avatar Jan 21 '21 03:01 meghasethi7861