Skip to content

Watermark not working #275

@bymayo

Description

@bymayo

I'm submitting a...

  • bug report
  • feature request
  • general question

Description

I'm trying to use the watermark feature, and it doesn't seem to be rendering anything no matter which way I try to implement this. Ideally i want to do this in the imager-x-transforms.php file like this:

'awardSilver' => [
        'transforms' => [
            ['width' => 400],
            ['width' => 800],
            ['width' => 1200],
            ['width' => 1600],
            ['width' => 1800]
        ],
        'defaults' => [
            'watermark' => [ 
                'image' => '@webroot/dist/images/watermark-award-silver.png', 
                'width' => 80, 
                'height' => 80, 
                'position' => [ 
                    'bottom' => 30, 
                    'right' => 30 
                ], 
                'opacity' => 1
            ]
        ]
    ],

I've also tried using an Asset model by using:

'image' => Craft::$app->getAssets()->getAssetById(353),

And i've also tried this inside the template using Twig, by setting this similar to how it says in the docs.

But still no luck!

I can see the transform is rendering fine, because if I change the width params, it recreates a new file. But does nothing with the watermark.

Displayed errors, stack trace, relevant logs

n/a, I can't see any errors appearing in the logs

Additional info

CleanShot 2024-11-19 at 10 22 56@2x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions