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

samalapsy's avatar

Image intervention - Image source not readable

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

0 likes
8 replies
fraserk's avatar

Does it tell's you which line it failing at? At least we know exactly where's it failing.

samalapsy's avatar

@fraserk yes. This line

$watermark = Image::make(public_path('img/logo.png'));

Pointing to this particulary code

public_path('img/logo.png')
fraserk's avatar

Okay, you say it works locally, did you verify that logo.png is on the production server and the path is correct.

fraserk's avatar

Try adding a slash / before img.

public_path('/img/logo.png')
samalapsy's avatar
samalapsy
OP
Best Answer
Level 2

Already solved it...I had to remove the

public_path()

because it's adding public to my image link.

I say a very big thank you to @fraserk for your time, effort and support.

Thanks man, Thank You Everyone.

3 likes
salarpro's avatar

I have fixed mine by changing the public_path

$imagePath = "/home/example.com/laravel/storage/app/public/" . $imageFileName

Image::make(SPImagePath::getImagePath($imagePath))->fit(720, 720)->save();

Please or to participate in this conversation.