image
image copied to clipboard
Image source not readable while adding watermark to image
I want to add watermark to my images but It's throwing the error "Image source not Readable". I've used it on my local host and it worked fine. Please kinldy help me check what's wrong. Thank You.
I've tried this
$fileName = "img-".$key. "." . strtolower($image->getClientOriginalExtension());
$img = Image::make($image->getRealPath());
$watermark = Image::make(public_path('img/logo.png'));
$img->insert($watermark)->save($path.'/'.$fileName);
and this
$fileName = "img-".$key. "." . strtolower($image->getClientOriginalExtension());
$img = Image::make($image->getRealPath());
$img->insert(public_path('img/logo.png'))->save($path.'/'.$fileName);
But all still give the same Image source not readable error
I've found the problem..
public_path() // is add 'public' to my image url so I had to remove it