Aspose.PSD for .NET 22.11 - Release Notes

Key Summary Category
PSDNET-1320 Can not export extremely big PSB files Enhancement
PSDNET-659 Make the center of the radial gradient movable Feature
PSDNET-1330 Unsupported ZipWithoutPrediction compression method for the specific files Feature
PSDNET-735 After using a transformation method for a layer only, the saved layer has incorrect bounding box Bug
PSDNET-1234 Exception on loading PSD image with pattern Bug
PSDNET-1244 Image export failed (IndexOutOfRangeException) on the saving of PSD file with Chinese symbols Bug
PSDNET-1303 TimeLine ActiveFrame applies incorrect Bug
PSDNET-1307 Regression 22.7: incorrect rendering of text with arabic characters Bug
PSDNET-1321 Vector Mask on the Group Layer works incorrect. Final image has the black hole but shouldn’t Bug

Public API Changes

Added APIs:

  • M:Aspose.PSD.FileFormats.Psd.Layers.TextLayer.Resize(System.Int32,System.Int32,Aspose.PSD.ResizeType)

Removed APIs:

  • None

Usage examples:

PSDNET-659. Make the center of the radial gradient movable

string sourceFile = "psdnet659.psd";
string outputFile = "output.png";

using (var psdImage = (PsdImage)Image.Load(sourceFile))
{
    FillLayer radialLayer = (FillLayer)psdImage.Layers[5];
    GradientFillSettings settings = (GradientFillSettings)radialLayer.FillSettings;

    // Update the offset point
    settings.HorizontalOffset = 10;
    settings.VerticalOffset = -25;

    psdImage.Save(outputFile, new PngOptions());
}

PSDNET-735. After using a transformation method for a layer only, the saved layer has incorrect bounding box

string sourceFileName = @"TextLayer.psd";
string outputFile = "TextLayerResized_output.psd";

using (PsdImage image = (PsdImage)Image.Load(sourceFileName, new PsdLoadOptions()))
{
    TextLayer textLayer = (TextLayer)image.Layers[1];

    // It sets new size of text layer
    const int NewWidth = 250;
    const int NewHeight = 250;

    // It sets the mechanism for how the resize function will resize the layer (default value)
    ResizeType resizeType = ResizeType.NearestNeighbourResample;

    // New mechanism of resizing for text layer using here
    // Not only the layer but also the transformation matrix of text layer will be changed
    textLayer.Resize(NewWidth, NewHeight, resizeType);

    image.Save(outputFile, new PsdOptions(image));
}

using (PsdImage image = (PsdImage)Image.Load(outputFile, new PsdLoadOptions()))
{
    TextLayer txtLayer = (TextLayer)image.Layers[1];

    // Reason of delta is different default font
    if (txtLayer.TransformMatrix[4] >= 65 
        && txtLayer.TransformMatrix[4] <= 67
        && txtLayer.TransformMatrix[5] >= 234
        && txtLayer.TransformMatrix[5] <= 237)
    {
        // All is OK
    }
    else
    {
        throw new Exception("Location point is wrong");
    }
}

PSDNET-1234. Exception on loading PSD image with pattern

string srcFile = "test.psd";
string output = "output1234.png";

using (PsdImage psdImage = (PsdImage)PsdImage.Load(srcFile,
new PsdLoadOptions() { LoadEffectsResource = true }))
{
    PngOptions pngOptions = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };
    psdImage.Save(output, pngOptions);
}

PSDNET-1244. Image export failed (IndexOutOfRangeException) on the saving of PSD file with Chinese symbols

string sourceFile = "input.psd";
string outputPath = "output.psd";

var loadOptions = new PsdLoadOptions
{
    LoadEffectsResource = true,
    UseDiskForLoadEffectsResource = true
};

using (var image = (PsdImage)Image.Load(sourceFile, loadOptions))
{
    foreach (var layer in image.Layers)
    {
        if (layer.Name == "1")
        {
            var txtLayer = (TextLayer)layer;

            txtLayer.UpdateText("测试测试");
        }
    }

    // Here should be no exception.
    image.Save(outputPath, new PsdOptions() { CompressionMethod = CompressionMethod.RLE, ColorMode = ColorModes.Rgb });
}

PSDNET-1303. TimeLine ActiveFrame applies incorrect

string src = "timeline1303.psd";
string output = "out_timeline.psd";

using (var psdImage = (PsdImage)Image.Load(src))
{
    TimeLine timeLine = TimeLine.InitializeFrom(psdImage);

    timeLine.ActiveFrame = 2;
    timeLine.ApplyTo(psdImage);

    psdImage.Save(output);
}

PSDNET-1307. Regression 22.7: incorrect rendering of text with arabic characters

string testFontsFolder = "Fonts";
FontSettings.SetFontsFolder(testFontsFolder);
FontSettings.UpdateFonts();

string sourceFilePath = "sarbarg.fin12.psd";
string outputFilePath = "result.tiff";

using (var psdImage = (PsdImage)Image.Load(sourceFilePath))
{
    psdImage.Save(outputFilePath, new Aspose.PSD.ImageOptions.TiffOptions(TiffExpectedFormat.TiffLzwRgb));
}

PSDNET-1320. Can not export extremely big PSB files

string sourceFile = "hf-mim-liman-han-guc-art-kuvvet.psb";
string psdExportPath = "hf-mim-liman-han-guc-art-kuvvet.png";

using (var image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { ReadOnlyMode = true }))
{
    image.Save(psdExportPath, new PngOptions() { ColorType =  PngColorType.TruecolorWithAlpha });
}

PSDNET-1321. Vector Mask on the Group Layer works incorrect. Final image has the black hole but shouldn’t

string srcFile = "demo.psd";
string output = "demo_net.png";

using (PsdImage im = (PsdImage)PsdImage.Load(srcFile))
{
    PngOptions pngOptions = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };
    im.Save(output, pngOptions);
}

PSDNET-1330. Unsupported ZipWithoutPrediction compression method for the specific files

string sourceFile = "20221017_220706_0000.psd";
string outputFile = "20221017_220706_0000.jpg";

using (var image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { LoadEffectsResource = true }))
{
    ImageOptionsBase optionsBase = new JpegOptions() { Quality = 80 };
    image.Save(outputFile, optionsBase);
}