Hi Support,
I am writing to seek assistance with an issue I am encountering while working with PSD files using the Aspose.PSD library.
When attempting to save a PSD file after editing its layers, I am encountering an “Out of Memory” error. This occurs specifically at the line where I call the Save
method on the PsdImage
object.
Below is the code:
using (var im = (PsdImage)Aspose.PSD.Image.Load(fileName, new PsdLoadOptions()))
{
foreach (var layer in im.Layers)
{
if (layer.Name != "Layer 1")
{
var fillLayer = layer as FillLayer;
if (fillLayer != null)
{
var settings = fillLayer.FillSettings as IColorFillSettings;
if (settings != null)
{
settings.Color = Aspose.PSD.Color.FromName("White");
fillLayer.Update();
break;
}
}
unitModel.Add(new UnitMaster { UnitNo = layer.Name, StatusID = 1, BlockID = BlockID });
}
}
im.Save(fileName, true);
}
Below is the screenshot of error
image.png (18.4 KB)
Any assistance or insights you can provide to help resolve this issue would be greatly appreciated.