Ad

Re-size Image Using Laravel 5.2

- 1 answer

I installed a package intervention/image and tried to re-size image and save it in another directory but i have error
Image for reference$img = Image::make('public/ddd.jpg')->resize(320, 240)->insert('public/watermark.png');

Ad

Answer

Try this:

$img = Image::make(public_path('ddd.jpg'))->resize(320, 240)->insert(public_path('watermark.jpg'));

Assuming the files ddd.jpg and watermark.jpg are in your public folder. public_path() is a helper function built in Laravel. See: https://laravel.com/docs/5.2/helpers#method-public-path.

Ad
source: stackoverflow.com
Ad