Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mikailfaruqali's avatar

Image source not readable

hi friends this is my code

            if ($data->hasFile('product_img')) {
                $image = $data->file('product_img');
                $input['image_name'] = uniqid() . '.' . $image->getExtension();

                $destinationPath = public_path('/images/backend/products');
                $img = Image::make($image->getRealPath());
                $img->orientate()
                    ->resize(600, 600, function ($constraint) {
                        $constraint->aspectRatio();
                        $constraint->upsize();
                    })
                    ->save($destinationPath . '/' . $input['image_name']);
            }

thanks

0 likes
4 replies
martinbean's avatar

thanks

@mikailfaruqali No problem?

If you need help, maybe ask an actual question instead of just dumping some code and expecting us to figure out just exactly what it is you’re asking about.

1 like
mikailfaruqali's avatar

@martinbean sorry brother my english not good as well i'm using intervention/image package and give me this error with laravel 9

Intervention\Image\Exception\NotReadableException
jlrdw's avatar

Also is your form correct:

enctype="multipart/form-data"

What is showing in your network tab. Etc.

1 like

Please or to participate in this conversation.