TYPO3 Image Viewhelper to set Watermark on FAL Images

Is there any extension or viewhelper available which sets a watermark on a given FAL object? Currently I use compositeImage() of nativ \Imagick Object to do this, which is not a really clean solution.

Upvotes: 0

Views: 515

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

Maybe you can build your own viewhelper based on typoscript.
There are a lot of solutions to insert watermarks into images with typoscript.

Your 'viewhelper' call could be:

<f:cObject typoscritpObjectPath="lib.watermark" data="{image}" />

while the typoscript looks like this:

lib.watermark = GIFBUILDER
lib.watermark {

    // use the current image. this might need some adaption
    10 = IMAGE
    10 {
        file = current
        treatIdAsReference = 1
    }

    // add some text
    20 = TEXT
    20 {      
        text = © Name
        fontSize = 30
        fontColor = #F78F1E
        offset = [10.w]-[20.w]-10,[10.h]-10
    }

    //   add an overlay image
    30 = IMAGE
    30.file = EXT:site_ext/Resources/Private/img/watermark.png
    30.mask = EXT:site_ext/Resources/Private/img/watermark.png

    XY = [10.w],[10.h]
}

Upvotes: 1

Related Questions