mardi 24 décembre 2019

Laravel 5.5 + image not readable error (used Intervention\Image)

I used ImageOptimizer package for reducing image size. source: http://image.intervention.io/getting_started/installation

in controller

        if (Input::hasFile('title_image')) {

            $Product = Input::file('title_image');
            $filename = time() . '.' . $Product->getClientOriginalExtension();

            Image::make($Product)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename) )->move(public_path() . '/../../products', md5($Product->getClientOriginalName()) . ".png");

            $product->title_img = "products/" . md5($Product->getClientOriginalName()) . ".png";

        }

how can I fix this error image not readable ???



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire