Add a Text Watermark to an Image on Upload to SharePoint
Add a Text Watermark to an Image on Upload to SharePoint
![](https://blog.encodian.com/wp-content/uploads/2020/11/Splash.png)
This blog post provides detailed steps on how to add a text watermark (also referred to as a stamp) to an image as it is uploaded to a SharePoint library. For this scenario, we will watermark the image with the filename (excluding the file extension) and the date it was added to the library.
To do this we will use the Encodian connectors ‘Add Text Watermark to Image‘ action.
NOTE: At the time of writing this action is being rolled out by Microsoft and is expected to reach all Power Automate regions by early December 2020.
Guidance: Adding a watermark (or stamp) to an image with Power Automate
A new SharePoint library called ‘Sites of Birmingham’ has been created where we will store images of the UK’s fabulous second city (No bias here!).
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog1-2-1024x391.png)
Now lets configure the flow!
1. Launch Power Automate – https://powerautomate.microsoft.com and create a new ‘Automated flow–from blank‘
2. Give the Flow a meaningful name and select the SharePoint ‘When a file is created (properties only)’ trigger action. When you are happy click ‘Create’
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog2-1024x597.png)
3. Configure the Trigger action to respond to files added to the ‘Sites of Birmingham’ library.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog3-1024x353.png)
4. Next we need to check that the file that has been added is of an image format. To do this we can use a ‘Condition‘ action and check the ‘File name with extension‘ property returned from the trigger ends with either .png, .jpg or .bmp
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog4-1024x590.png)
5. The negative route of the condition should terminate the flow.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog5-1024x376.png)
6. The positive route of the condition will then get the file content, add the watermark and finally update the image in the library.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog6-1024x660.png)
Let’s break down those steps.
6a. ‘Get file content‘ will retrieve the base64 encoded content of the file from the library using the ‘Identifier‘ property returned from the trigger.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog7-1-1024x314.png)
6b. We then pass the file content returned by the previous action to the Encodian ‘Add Text Watermark to Image‘ action specifying the following properties:
- Filename – ‘Filename with extension“‘property returned from the trigger action
- File Content – ‘File Content‘ property returned from the ‘Get File Content‘ action
- Text – ‘Name‘ property from the trigger action followed by today’s date formatted as ‘dd/MM/yyyy‘
- Watermark Position – TopRight
- Font – Arial
- Text Colour – #eb9e34
- Text Size – 4
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog8-1024x735.png)
6c. Finally, we call the ‘Update File‘ action to commit the changes to the file back to the ‘Sites of Birmingham‘ SharePoint library, passing in the ‘Identifier‘ property returned from the trigger action and the ‘File Content‘ property returned by the Encodian ‘Add Text Watermark to Image‘ action.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Blog9-1024x316.png)
7. With the flow complete we are ready to test. We will use the following two images which will be uploaded to the ‘Sites of Birmingham’ SharePoint library.
![](https://blog.encodian.com/wp-content/uploads/2020/11/Birmingham-Central-Library-1024x683.jpg)
![](https://blog.encodian.com/wp-content/uploads/2020/11/Birmingham-Colmore-Row-1024x614.jpg)
8. And here is the output!
![](https://blog.encodian.com/wp-content/uploads/2020/11/Birmingham-Central-Library-1-1024x683.jpg)
![](https://blog.encodian.com/wp-content/uploads/2020/11/Birmingham-Colmore-Row-1-1024x614.jpg)
Finally…
Hopefully this has provided some insights into a practical use of this powerful new action from Encodian.
posted on 2020-12-13 10:32 lingdanglfw 阅读(146) 评论(0) 编辑 收藏 举报