We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Imaging DrawString does not work in IIS app

There is an issue with Aspose.Imaging 21.8 and later versions.
This issue was not in 21.7 and older versions.

DrawString() does nothing (no exception raised) when our web app runs in IIS with Load User Profile set to false (which is a default setting).
It works only when Load User Profile is set to True.

I hope this issue will be resolved in next releases.

@valuepro Please provide code sample that reproduces the issue and your environment configuration.

This is the code:

string localPhotoPath = @“C:…\image1.jpg”;
using (Aspose.Imaging.Image waterImage = Aspose.Imaging.Image.Load(localPhotoPath))
{
float waterOpacity = 0.9f;
Aspose.Imaging.Color waterColor = Aspose.Imaging.Color.Gold;
int waterOpacityAlpha = (int)(waterOpacity * 255 + 0.5);
waterColor = Aspose.Imaging.Color.FromArgb(waterOpacityAlpha, waterColor);
Aspose.Imaging.Brushes.SolidBrush waterSolidBrush = new Aspose.Imaging.Brushes.SolidBrush(waterColor);
Aspose.Imaging.Graphics waterGraphics = new Aspose.Imaging.Graphics(waterImage);
waterGraphics.DrawString(“17 June 2022 at 11:25”, new Aspose.Imaging.Font(“Arial”, 12f), waterSolidBrush, new Aspose.Imaging.PointF(10, waterImage.Height - 25));
waterImage.Save();
}

This is part of a web app that runs in IIS.
IIS app pool has a setting named “Load User Profile”
When it is set to false (default value), this code does nothing. - no exception, no text added to the image.
When it is set to true, the code works.

@valuepro Thank you. We have created an internal ticket IMAGINGNET- 5657 concerning this issue. We will investigate it and you will be notified on the result.

@valuepro As a temporary workaround solution, you can use the following line in the project file:

  <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>

And we have an internal ticket IMAGINGNET-4886 regarding this issue, you will be notified on its completion.