How to set watermark server side?

How to set watermark server side?

  

Hi,

In our project we need to have possibility to process images server side to set a watermark text on them. What is the best way to do it in OS ?

Thank you.

Hi Mykola,

If there isn't any extension in forge that can do it already, I would say the best way would be to create an extension that uses one of the available command line tools to deal with images, like Image Magik. 

Pretty much in the same way the HTMLtoPDF extension works.

Cheers,
Eduardo Jauch

There's ImageToolbox in the Forge, that wraps ImageMagik, but since ImageMagik does not support C# (afaik) it's a wrapper around the executable (indeed like HTMLtoPDF).

If you are using the .NET stack, I'd take a look at e.g. ImageProcessor, a free C# library, which seems easy enough to create a wrapper for.

Thank you very much for suggestions. Probably we will proceed with creating our own component.

Will it require any installations to the server (we are using outsystems cloud ) ?

Hi Mykola,

No, if you create an extension, you add everything that's needed for it (like an external library). Just add it to the Resources (at the Resource tab), library's typically go in the Bin folder.

Solution

Just to let you know that there are 2 components now that support watermarks :)


ImageToolbox (https://www.outsystems.com/forge/component/2/imagetoolbox/) adds watermark with following options  -gravity south -annotate 0 'You text here' https://www.outsystems.com/forums/discussion/33119/adding-text-to-the-image-not-working/

And MediaToolkit (https://www.outsystems.com/forge/Component_Versions.aspx?ProjectId=2693) that is a wrapper for ImageProcessor now has watermark action.



Solution

Great to see you contributed to an existing component Mykola!

Nice! :)