Aspose.PSD for .NET 21.12 - Release Notes

Key Summary Category
PSDNET-997 Add ability to programmatically limit fonts using Feature
PSDNET-785 Aspose.PSD 20.10: Failed to load PSD Bug
PSDNET-812 ImageLoad exception on loading PSD Bug
PSDNET-870 ImageLoad exception on loading PSD layer with unsupported CompressionMethod Bug
PSDNET-918 Aspose.PSD 21.6: Compression method is not supported for a PSD file Bug
PSDNET-984 Incorrect saving of vector path with a mask Bug
PSDNET-1001 Incorrect font in the TextPortion in a specific file Bug
PSDNET-1031 Compression method is not supported exception on image loading Bug
PSDNET-1033 Index out of range on the saving in the specific file Bug
PSDNET-1036 Add support of PathStructure to avoid the load file error Bug

Public API Changes

Added APIs:

  • T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure
  • M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.#ctor(Aspose.PSD.FileFormats.Psd.Layers.LayerResources.ClassID)
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.Key
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.Prefix
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.Path
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.Length
  • F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.TypeToolInfoStructures.PathStructure.StructureKey
  • M:Aspose.PSD.FontSettings.SetAllowedFonts(System.String[])
  • M:Aspose.PSD.FontSettings.IsFontAllowed(System.String)
  • M:Aspose.PSD.FontSettings.GetReplacementFont(System.String)
  • M:Aspose.PSD.FontSettings.GetFontReplacements(System.String)
  • M:Aspose.PSD.FontSettings.SetFontReplacements(System.String,System.String[])
  • M:Aspose.PSD.FontSettings.ClearFontReplacements

Removed APIs:

  • None

Usage examples:

PSDNET-785. Aspose.PSD 20.10: Failed to load PSD

            string src = "ShimadzuLetterhead100.psd";
            string output = "output.psd";
            using (var img = (PsdImage)Image.Load(src, new PsdLoadOptions() { ReadOnlyMode = true }))
            {
                img.Save(output);
            }

PSDNET-812. ImageLoad exception on loading PSD

            string src = "5-MX10600_Amazon_DEVICES_2_1000x1000.psd";
            string output = "output.psd";
            using (var img = (PsdImage)Image.Load(src))
            {
                img.Save(output);
            }

PSDNET-870. ImageLoad exception on loading PSD layer with unsupported CompressionMethod

            string srcFile = "sourceFile.psd";
            string output = "output.psd";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                image.Save(output);
            }

PSDNET-918. Aspose.PSD 21.6: Compression method is not supported for a PSD file

            string srcFile = "Fb-blue-jury (1).psd";
            string output = "output.psd";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                image.Save(output);
            }

PSDNET-984. Incorrect saving of vector path with a mask

            string srcFile = "PsdConvertToPngExample.psd";
            string outputFilePng = "output.png";

            using (var psdImage = (PsdImage)Image.Load(srcFile, new PsdLoadOptions() { LoadEffectsResource = true }))
            {
                psdImage.Save(
                    outputFilePng,
                    new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha, Progressive = true, CompressionLevel = 9 });
            }

PSDNET-997. Add ability to programmatically limit fonts using

            string srcFile = "fonts_com_updated.psd";
            string output = "etalon_fonts_com_updated.psd.png";

            try
            {
                var fontList = new string[] { "Courier New", "Webdings", "Bookman Old Style" };
                FontSettings.SetAllowedFonts(fontList);

                var myriadReplacement = new string[] { "Courier New", "Webdings", "Bookman Old Style" };
                var calibriReplacement = new string[] { "Webdings", "Courier New", "Bookman Old Style" };
                var arialReplacement = new string[] { "Bookman Old Style", "Courier New", "Webdings" };
                var timesReplacement = new string[] { "Arial", "NotExistedFont", "Courier New" };

                FontSettings.SetFontReplacements("MyriadPro-Regular", myriadReplacement);
                FontSettings.SetFontReplacements("Calibri", calibriReplacement);
                FontSettings.SetFontReplacements("Arial", arialReplacement);
                FontSettings.SetFontReplacements("Times New Roman", timesReplacement);

                using (PsdImage image = (PsdImage)Image.Load(srcFile))
                {
                    image.Save(output, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
                }
            } 
            finally
            {
                FontSettings.SetAllowedFonts(null);
                FontSettings.ClearFontReplacements();
            }

PSDNET-1001. Incorrect font in the TextPortion in a specific file

            string srcFile = "fonts_com.psd";
            string output = "output.png";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                var tl = (TextLayer)image.Layers[1];
                var fontName = tl.TextData.Items[0].Style.FontName;
                if (fontName != "MyriadPro-Regular")
                {
                    throw new Exception("Incorrect font");
                }

                // We should get Myriad Pro, by we see AdobeInvisFont
                image.Save(output, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
            }

PSDNET-1031. Compression method is not supported exception on image loading

            string srcFile = "shirt-error.psd";
            string output = "output.psd";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                image.Save(output);
            }

PSDNET-1033. Index out of range on the saving in the specific file

            string srcFile = "237708.psd";
            string output = "output.png";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                image.Save(output, new PngOptions());
            }

PSDNET-1036. Add support of PathStructure to avoid the load file error

            string srcFile = "shirt-color.psd";
            string output = "output.psd";

            using (PsdImage image = (PsdImage)Image.Load(srcFile))
            {
                image.Save(output);
            }