Text as watermark in front-end
Created 7 years ago by pwrobelI need to add text as watermark to every image in gallery on page. I display gallery through page types, so I need a twig solution. I didnt find it in docs. Intervention library has o text method but i cant use it in twig. Is there any simple way to do this?
Image plugin / class in Pyro wraps Intervention and that method should be allowed. Something like this I imagine:
{{ image('theme::img/my-image.jpg').insert(image_path('theme::another/image.jpg'), bottom-right, 10, 10)|raw }}
Yup, there is no problem with insert image as watermark. Problem is that I need insert text as watermark. I tried to use {{ image('path').text(' my text).url() }} (intervention has text method) but it didnt work for me. I think insert method shouldn't work too in this case.
Aha! Good call - I've added it to the allowed methods: https://github.com/anomalylabs/streams-platform/commit/60393bc4f46a7c51cbd2ae675c08983f5aae3242
Let me know how this works!
Bah looks like they're working but I need to map the closure options to an array of config for the plugin use:
See my pathetic example / output lol: https://image.prntscr.com/image/ead0d1e21f494f63a64f0ac0a03cb94c.png
That's at like 300% zoom
I'll get this knocked out and let you know.
Check the files documentation. My guess is the method hasn't been enabled by Ryan at all, which is why you can't use it in twig.
To get it fixed make an issue on GitHub.