Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watermark filter dynamic path #537

Open
SoulviES opened this issue Dec 11, 2014 · 3 comments
Open

Watermark filter dynamic path #537

SoulviES opened this issue Dec 11, 2014 · 3 comments
Labels
State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution.

Comments

@SoulviES
Copy link

Hi, I was trying to apply a different watermark path depending of the user who uploaded a photo, i tried with a runtimeConfig but i don't know how to do correctly.

I do this:

{% set runtimeConfig = {"watermark": {"size": 0.5, "image": premium.watermark, "position": 'bottomright' }} %}
                    <img  src="{{asset(photo.path | imagine_filter('grid_thumb', runtimeConfig))}}" >

In the config.yml i have this:

        grid_thumb:
            quality: 50
            filters:
                thumbnail: { size: [244, 244], mode: outbound }

This is the error in the profiler:

Signed url does not pass the sign check for path "PHOTO-ROUTE" and filter "grid_thumb" and runtime config {"watermark":{"size":"0.5","image":"WATERMARK-ROUTE","position":"bottomright"}}

@SoulviES SoulviES changed the title Watermark filter dinamic path Watermark filter dynamic path Dec 11, 2014
@trsteel88
Copy link
Contributor

@Ipshal, I believe you will need a base configuration for watermark in your config to do this.

e.g you need:

        grid_thumb:
            quality: 50
            filters:
                thumbnail: { size: [244, 244], mode: outbound }
                watermark:
                    # Relative path to the watermark file (prepended with "%kernel.root_dir%/")
                    image: Resources/data/watermark.png
                    size: 0.5
                    position: center

Once you have the base configuration, you can then override the options. Also, where you position the filter will determine when it will be applied (e.g, if you want the watermark applied to the image before the thumbnail filter is run, you need to move it above the thumbnail filter).

@anacicconi
Copy link

Hello, were you able to make this work? I'm searching for a way to display dynamic watermarks on twig and I just tried your solution but it doesn't work. My image for the watermark comes from S3. So for the image variable I inform the complete url of the bucket where we can download the photo.

@michellesanver michellesanver added the State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution. label Oct 4, 2019
@michellesanver
Copy link
Contributor

There seems to possible be/have been issues with watermarks? Let's clarify and potentially improve the docs and/or create a new issue for a new feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Need To Investigate 🔎 This item requires additional investigation to determine a resolution.
Projects
None yet
Development

No branches or pull requests

4 participants