awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
298 stars 79 forks source link

Watermark doesn't work #450

Closed erenergul closed 4 months ago

erenergul commented 4 months ago

Filament Version

v3.2.37

Plugin Version

v3.4.12

PHP Version

PHP 8.2

Problem description

I am using curator but couldnt add watermark. I dont understand why.

 <x-curator-glider
                            class=""
                            :media="$image"
                            background=""
                            blur=""
                            border=""
                            crop=""
                            device-pixel-ratio=""
                            filter=""
                            fit=""
                            flip=""
                            format=""
                            quality=""
                            orientation=""
                            pixelate=""
                            sharpen=""
                            width=""
                            watermark-path="{{asset('img/watermark.png')}}"
                            watermark-width="200"
                            watermark-height="200"
                            watermark-x-offset="20"
                            watermark-y-offset="20"
                            watermark-padding="20"
                            watermark-position="top"
                            watermark-alpha="40"
                        />

Image is working. I can see image and I can see watermark path from image payload. Everything looks okay. but watermark doesnt show.

Expected behavior

Should work with this code.

Steps to reproduce

Have no idea.

Reproduction repository

No response

Relevant log output

No need because its simple basic project. Fresh and clean install.
awcodes commented 4 months ago

Will look into this as soon as I can.

Thanks.

awcodes commented 4 months ago

Ok, you're going to need to create a custom Glide server factory to be able to use watermarks.

https://glide.thephpleague.com/2.0/api/watermarks/ https://github.com/awcodes/filament-curator?tab=readme-ov-file#custom-glide-server

erenergul commented 4 months ago

Ok, you're going to need to create a custom Glide server factory to be able to use watermarks.

https://glide.thephpleague.com/2.0/api/watermarks/ https://github.com/awcodes/filament-curator?tab=readme-ov-file#custom-glide-server

Thank you for your help. I have also want to tell you something about annoying issue :)

watermark-path="/avatar.png"

if you don't put " / " can't display watermark.

I also put end of ServerFactory but still not working. Didn't realize for a while :)

'watermarks' => new Filesystem(new LocalFilesystemAdapter(public_path('img/'))),

Now everything is working. Thank you for your help.