Free Support Forum - aspose.com

Break watermark text on different platforms

Hey,

I am writing to you because I ran into the following problem: I would like to add a long watermark text on an image that is surely longer than the image side (so it would overflow or break). On Windows it is working fine, text breaks automatically. On Linux version however (which runs the same code), text does not break at the edge of the image.

Behaviours:

  • Windows: no need for separator characters (e.g: space) to break the lines
  • Linux: requires separator characters and it is not consistent if it will break the lines

DLL version: 20.7.0

At first glance, it seems to us that .Net Core behaves differently a bit on the 2 platforms because of their diverse encoding handling and that can lead Aspose.Imaging to break lines differently.

I would be interested if you know about such an issue and would be grateful if you could provide some feedback or solution for that.

Thank you,
Tamas Boldizsar

@tamas.boldizsar

Can you please first try using latest Aspose.Imaging for .NET 20.8 on your end. In case there is still an issue then please share the working sample project (not code snippet) that is working on Windows and failing on Linux platforms. Please also provide the output and snapshot of two different Operating systems execution results along with Operating System details.

@mudassir.fayyaz, thank your for your reply!

I have tried version 20.8, but the results were the same unfortunately.

I have also created a simple dotnet console project for demonstrating the problem, I attached it in a .zip file. It was built and run successfully on both platforms, but produced different results, as you can see on the output images in the test_files folder. (I have already described the difference in my previous post.)

I used the following commands for building and running the project (from the root folder):
dotnet build
dotnet run -p Common/Common.csproj ./licence/Aspose.Total.lic ./test_files/image.jpg
The first argument is the path to the Aspose Total licence file, the second one is the path to the image I want to be watermarked. The output will be located next to the original image.

OS details:

  • Linux Ubuntu 20.04.1 LTS
  • Microsoft Windows 10 Professional

Thank you for your further investigation!
aspose-imaging.zip (794.8 KB)

@tamas.boldizsar

I have created an issue with ID IMAGINGNET-4141 after observing the difference of outputs in two platforms. We will share the good news with you as soon as the issue will be fixed.

@mudassir.fayyaz

Thank you for your effort!

@tamas.boldizsar

You are always welcome.