1

First time using the Imager plugin and really unsure how to code it. Looking over the documentation I'm not clear on what the 'logo' is referring to to know what to change it to:

{ watermark: { image: logo, width: 80, height: 80, position: { right: 30, bottom: 30 }, opacity: 0.8, blendMode: 'multiply' } }

https://github.com/aelvan/Imager-Craft

My attempt so far:

{% set imageWatermark = [{ watermark: { image: logo, width: 80, height: 80, position: { right: 30, bottom: 30 }, opacity: 0.8, blendMode: 'multiply' } }] %}

{% set transformedImages = craft.imager.transformImage(image, imageWatermark) %}

{# Output image #}
<img src="{{ asset.getUrl('transformedImages') }}">
2

Have a look a little further down in the Readme and you will see more information regarding Watermark.

From the Readme...

image: The image that is to be used as watermark. Just as the image parameter in the craft.imager.transformImage method, this can be an AssetFileModel, a string to a previously transformed Imager image, or a string to an external image.

{% set logo = craft.assets({ id: 11 }).first() %}
{% set watermarkedImage = craft.imager.transformImage(image, { 
    width: 600, 
    watermark: { image: logo, width: 80, height: 80, position: { right: 30, bottom: 30 }, opacity: 0.8, blendMode: 'multiply' }
}) %}

Also a link to a Watermark demo https://imager.vaersaagod.no/?img=6&demo=watermarks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.