Level 34
@samehdev it means public_path('unnamed.png') is not found?
Are you sure unnamed.png is in the public folder?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
laravel 8
php 8
"spatie/laravel-medialibrary": "^9.0.0",
'image_driver' => env('IMAGE_DRIVER', 'gd'),
model :
public function registerMediaCollections(): void
{
$this->addMediaCollection('photo')
->useFallbackUrl(asset('no-image.jpg'))
->useFallbackPath(public_path('no-image.jpg'))
->acceptsMimeTypes(['image/jpeg', 'image/png', 'image/webp', 'image/svg', 'image/jpg', 'image/gif'])
->onlyKeepLatest(10)
->registerMediaConversions(function (Media $media) {
$this
->addMediaConversion('sm')
->width(348)
->height(273)
->watermark(public_path('unnamed.png'))
->watermarkOpacity(45)
->watermarkPosition(Manipulations::POSITION_BOTTOM_LEFT) // Watermark at the top
->watermarkHeight(13, Manipulations::UNIT_PERCENT) // 50 percent height
->watermarkWidth(21, Manipulations::UNIT_PERCENT)
->watermarkPadding(15)
->sharpen(10)
->format('webp')
->nonQueued();
$this->addMediaConversion('md')
->width(1200)
->height(800)
->watermark(public_path('unnamed.png'))
->watermarkOpacity(35)
->watermarkPosition(Manipulations::POSITION_BOTTOM_LEFT) // Watermark at the top
->watermarkHeight(15, Manipulations::UNIT_PERCENT) // 50 percent height
->watermarkWidth(21, Manipulations::UNIT_PERCENT)
->watermarkPadding(30)
->sharpen(10)
->format('webp');
$this->addMediaConversion('lg')
->sharpen(10)
->format('webp')
->nonQueued();
});
}
The error only occurs when using watermark
Error:
Intervention\Image\Exception\NotReadableException
Image source not readable
Please or to participate in this conversation.