Aspose.PSD for .NET 24.2 - Release Notes
Contents
[
Hide
]
This page contains release notes forĀ Aspose.PSD for .NET 24.2
Key | Summary | Category |
---|---|---|
PSDNET-1503 | Handle Angle property for PatternFillSettings | Feature |
PSDNET-1719 | Support of vertical and horizontal scale for TextLayer | Feature |
PSDNET-1783 | [AI Format] Implement correct rendering of background in PDF-Based AI Format | Feature |
PSDNET-1611 | Change Distort mechanism in warp | Enhancement |
PSDNET-1802 | Speed up warp | Enhancement |
PSDNET-995 | “Image loading failed.” exception when open document | Bug |
PSDNET-1491 | Fix saving psd files having Stroke Pattern | Bug |
PSDNET-1642 | The text style is incorrect in a smart object when we use ReplaceContents | Bug |
PSDNET-1884 | [AI Format] Fix the Cubic Bezier rendering at AI file | Bug |
Public API Changes
Added APIs:
- P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.PtFlResource.Angle
Removed APIs:
- None
Usage examples:
PSDNET-1503. Handle Angle property for PatternFillSettings
string sourceFile = Path.Combine(baseFolder, "PatternFillLayerWide_0.psd");
string outputFile = Path.Combine(outputFolder, "PatternFillLayerWide_0_output.psd");
using (PsdImage image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions { LoadEffectsResource = true }))
{
FillLayer fillLayer = (FillLayer)image.Layers[1];
PatternFillSettings fillSettings = (PatternFillSettings)fillLayer.FillSettings;
fillSettings.Angle = 70;
fillLayer.Update();
image.Save(outputFile, new PsdOptions());
}
using (PsdImage image = (PsdImage)Image.Load(outputFile, new PsdLoadOptions { LoadEffectsResource = true }))
{
FillLayer fillLayer = (FillLayer)image.Layers[1];
PatternFillSettings fillSettings = (PatternFillSettings)fillLayer.FillSettings;
Assert.AreEqual(70, fillSettings.Angle);
}
PSDNET-1719. Support of vertical and horizontal scale for TextLayer
string src = Path.Combine(baseFolder, "1719_src.psd");
string output = Path.Combine(outputFolder, "out_1719.png");
using (var psdImage = (PsdImage)Image.Load(src))
{
psdImage.Save(output, new PngOptions());
}
PSDNET-1783. [AI Format] Implement correct rendering of background in PDF-Based AI Format
string sourceFile = Path.Combine(baseFolder, "pineapples.ai");
string outputFilePath = Path.Combine(outputFolder, "pineapples.png");
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
image.Save(outputFilePath, new PngOptions());
}
PSDNET-995. “Image loading failed.” exception when open document
string sourceFile1 = Path.Combine(baseFolder, "PRODUCT.ai");
string outputFile1 = Path.Combine(outputFolder, "PRODUCT.png");
using (AiImage image = (AiImage)Image.Load(sourceFile1))
{
image.Save(outputFile1, new PngOptions());
}
string sourceFile2 = Path.Combine(baseFolder, "Dolota.ai");
string outputFile2 = Path.Combine(outputFolder, "Dolota.png");
using (AiImage image = (AiImage)Image.Load(sourceFile2))
{
image.Save(outputFile2, new PngOptions());
}
string sourceFile3 = Path.Combine(baseFolder, "ARS_novelty_2108_out_01(1).ai");
string outputFile3 = Path.Combine(outputFolder, "ARS_novelty_2108_out_01(1).png");
using (AiImage image = (AiImage)Image.Load(sourceFile3))
{
image.Save(outputFile3, new PngOptions());
}
string sourceFile4 = Path.Combine(baseFolder, "bit_gear.ai");
string outputFile4 = Path.Combine(outputFolder, "bit_gear.png");
using (AiImage image = (AiImage)Image.Load(sourceFile4))
{
image.Save(outputFile4, new PngOptions());
}
string sourceFile5 = Path.Combine(baseFolder, "test.ai");
string outputFile5 = Path.Combine(outputFolder, "test.png");
using (AiImage image = (AiImage)Image.Load(sourceFile5))
{
image.Save(outputFile5, new PngOptions());
}
PSDNET-1491. Fix saving psd files having Stroke Pattern
string sourceFile = Path.Combine(baseFolder, "StrokeShapePattern.psd");
string outputFile = Path.Combine(outputFolder, "StrokeShapePattern_output.psd");
Rectangle newPatternBounds = new Rectangle(0, 0, 4, 4);
Guid guid = Guid.NewGuid();
string newPatternName = "$$$/Presets/Patterns/HorizontalLine1=Horizontal Line 9\0";
int[] newPattern = new int[]
{
Color.Aqua.ToArgb(), Color.Red.ToArgb(), Color.Red.ToArgb(), Color.Aqua.ToArgb(),
Color.Aqua.ToArgb(), Color.White.ToArgb(), Color.White.ToArgb(), Color.Aqua.ToArgb(),
Color.Aqua.ToArgb(), Color.White.ToArgb(), Color.White.ToArgb(), Color.Aqua.ToArgb(),
Color.Aqua.ToArgb(), Color.Red.ToArgb(), Color.Red.ToArgb(), Color.Aqua.ToArgb(),
};
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
ShapeLayer shapeLayer = (ShapeLayer)image.Layers[1];
PatternFillSettings strokeInternalFillSettings = (PatternFillSettings)shapeLayer.Fill;
PattResource pattResource;
foreach (var globalLayerResource in image.GlobalLayerResources)
{
if (globalLayerResource is PattResource)
{
pattResource = (PattResource)globalLayerResource;
PattResourceData patternItem = pattResource.Patterns[0]; // Stroke internal pattern data
patternItem.PatternId = guid.ToString();
patternItem.Name = newPatternName;
patternItem.SetPattern(newPattern, newPatternBounds);
break;
}
}
strokeInternalFillSettings.PatternName = newPatternName;
strokeInternalFillSettings.PatternId = guid.ToString() + "\0";
shapeLayer.Update();
image.Save(outputFile);
}
// Check changed data.
using (PsdImage image = (PsdImage)Image.Load(outputFile))
{
ShapeLayer shapeLayer = (ShapeLayer)image.Layers[1];
PatternFillSettings strokeInternalFillSettings = (PatternFillSettings)shapeLayer.Fill;
Assert.AreEqual(guid.ToString().ToUpper(), strokeInternalFillSettings.PatternId);
Assert.AreEqual(newPatternName, strokeInternalFillSettings.PatternName + "\0");
}
PSDNET-1642. The text style is incorrect in a smart object when we use ReplaceContents
string inputFile = Path.Combine(baseFolder, "source.psd");
string output2 = Path.Combine(outputFolder, "output.png");
PsdLoadOptions psdLoadOptions = new PsdLoadOptions();
psdLoadOptions.LoadEffectsResource = true;
using (PsdImage psdImage = (PsdImage)Image.Load(inputFile, psdLoadOptions))
{
SmartObjectLayer smartObject = (SmartObjectLayer)psdImage.Layers[1];
using (PsdImage smartObjectImage = (PsdImage)smartObject.LoadContents(psdLoadOptions))
{
smartObject.ReplaceContents(smartObjectImage);
}
psdImage.Save(output2, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
PSDNET-1884. [AI Format] Fix the Cubic Bezier rendering at AI file
string sourceFile = Path.Combine(baseFolder, "Typography.ai");
string outputFilePath = Path.Combine(outputFolder, "Typography.png");
using (AiImage image = (AiImage)Image.Load(sourceFile))
{
image.Save(outputFilePath, new PngOptions());
}
PSDNET-1611. Change Distort mechanism in warp
string sourceFile = Path.Combine(baseFolder, "crow_grid.psd");
string outputFile = Path.Combine(outputFolder, "export.png");
var opt = new PsdLoadOptions()
{
LoadEffectsResource = true,
AllowWarpRepaint = true
};
using (PsdImage img = (PsdImage)Image.Load(sourceFile, opt))
{
img.Save(outputFile, new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha });
}
PSDNET-1802. Speed up warp
string sourceFile = Path.Combine(baseFolder, "output.psd");
string outputFile = Path.Combine(outputFolder, "export.png");
var opt = new PsdLoadOptions()
{
LoadEffectsResource = true,
AllowWarpRepaint = true
};
var sw = new Stopwatch();
sw.Start();
using (PsdImage img = (PsdImage)Image.Load(sourceFile, opt))
{
img.Save(outputFile, new PngOptions() { CompressionLevel = 9, ColorType = PngColorType.TruecolorWithAlpha });
}
sw.Stop();
// old value = 193300
// new value = 55500
int timeInSec = (int)sw.Elapsed.TotalMilliseconds;
if (timeInSec > 100000)
{
throw new Exception("Process time is too long");
}