Aspose.PSD for .NET 23.12 - 发行说明

关键 摘要 类别
PSDNET-1679 [AI 格式] 在新版本的 AI 中添加了对栅格图像渲染的支持 功能
PSDNET-1454 处理 Gdfl 资源中的渐变类型噪音 功能
PSDNET-1827 在更新文本图层后保存时出现错误“对象引用未设置为对象的实例。” 缺陷
PSDNET-1776 修复在 MacOS 上使用 System.Drawing.Common 和 Aspose.Drawing 手动加载字体的问题 缺陷
PSDNET-1536 PsdLoadOptions 中的 AllowWarpRepaint 导致异常 缺陷
PSDNET-1714 [AI 格式] 实现交叉引用流的处理 功能增强
PSDNET-1834 VectorPathDataResource 的许可控制工作不正确 功能增强
PSDNET-770 在 PSD 图像中将任何图像文件作为嵌入式智能对象打开 功能增强
PSDNET-1864 Aspose.PSD 插件许可系统 功能增强

公共 API 更改

已添加的 API:

  • M:Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.#ctor(System.IO.Stream)
  • F:Aspose.PSD.FileFormats.Ai.AiFormatVersion.Pdf17
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.RndNumberSeed
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.ShowTransparency
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.UseVectorColor
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.Roughness
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.ColorModel
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.MinimumColor
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.MaximumColor
  • T:Aspose.PSD.FileFormats.Psd.Layers.Gradient.NoiseColorModel
  • F:Aspose.PSD.FileFormats.Psd.Layers.Gradient.NoiseColorModel.RGB
  • F:Aspose.PSD.FileFormats.Psd.Layers.Gradient.NoiseColorModel.HSB
  • F:Aspose.PSD.FileFormats.Psd.Layers.Gradient.NoiseColorModel.LAB
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.GradientMode
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.RndNumberSeed
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.ShowTransparency
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.UseVectorColor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.Roughness
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.ColorModel
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.MinimumColor
  • P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.GdFlResource.MaximumColor
  • T:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings
  • M:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.#ctor
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.GradientType
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.GradientName
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.FillType
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.Color
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.AlignWithLayer
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.Dither
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.Reverse
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.Angle
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.HorizontalOffset
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.VerticalOffset
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.ColorPoints
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.TransparencyPoints
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.Scale
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.BaseGradientFillSettings.GradientMode
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.GradientFillSettings.Interpolation
  • P:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.IGradientFillSettings.GradientMode
  • T:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings
  • M:Aspose.PSD.FileFormats.Psd.Layers.FillSettings.NoiseGradientFillSettings.#ctor
  • T:Aspose.PSD.CustomFontHandler.CustomFontData
  • M:Aspose.PSD.Metered.GetProductName
  • M:Aspose.PSD.Metered.IsMeteredLicensed
  • T:Aspose.PSD.PluginLicenseException
  • M:Aspose.PSD.PluginLicenseException.#ctor
  • M:Aspose.PSD.Metered.Equals(System.Object)

已移除的 API:

  • M:Aspose.PSD.Xmp.Schemas.XmpBaseSchema.XmpBasicPackage.ContainsKey(System.String)
  • M:Aspose.PSD.Metered.Equals(System.Object)

使用示例:

PSDNET-1679. [AI 格式] 在新版本的 AI 中添加了对栅格图像渲染的支持

            string sourceFile = Path.Combine(baseFolder, "raster.ai");
            string outputFile = Path.Combine(outputFolder, "raster_output.png");

            using (AiImage image = (AiImage)Image.Load(sourceFile))
            {
                image.Save(outputFile, new PngOptions());
            }

PSDNET-1454. 处理 Gdfl 资源中的渐变类型噪音

            string sourceFile = "Gradient-Fill.psd";
            string destFile = "Gradient-Fill-out.psd";

            using (var image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions()))
            {
                Layer layer = image.Layers[1];

                foreach (LayerResource resource in layer.Resources)
                {
                    GdFlResource gdFlResource = resource as GdFlResource;

                    if (gdFlResource != null)
                    {
                        gdFlResource.Scale = 90;
                        gdFlResource.Angle = 30;
                        gdFlResource.Dither = false;
                        gdFlResource.AlignWithLayer = true;
                        gdFlResource.Reverse = false;

                        break;
                    }
                }

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

PSDNET-1827. 在更新文本图层后保存时出现错误“对象引用未设置为对象的实例。”

string sourceFile = Path.Combine(baseFolder, "input_1827.psd");
string outputFile = Path.Combine(outputFolder, "out_1827.psd");

using (var psdImage = (PsdImage)Image.Load(sourceFile))
{
    foreach (var layer in psdImage.Layers)
    {
        if (layer is TextLayer textLayer)
        {
            textLayer.TextData.UpdateLayerData();
        }
    }

    // 这里不应该出现错误
    psdImage.Save(outputFile);
}

PSDNET-1536. PsdLoadOptions 中的 AllowWarpRepaint 导致异常

            string sourceFile = @"SizeChart-4 Colors.psd";
            string outputFile = @"SizeChart-4 Colors.png";

            using (var psdImage = (PsdImage)Aspose.PSD.Image.Load(sourceFile, new PsdLoadOptions() { AllowWarpRepaint = true, LoadEffectsResource = true })) 
			{ 
				psdImage.Save(outputFile + "_original.png", new PngOptions()
				{
					ColorType = PngColorType.TruecolorWithAlpha,
					Progressive = true,
					CompressionLevel = 9
				});
			}

PSDNET-1834. VectorPathDataResource 的许可控制工作不正确

 using (PsdImage im = (PsdImage)Image.Load(DifferentLayerMasks.psd))
 {
     im.Save(complexFiles[i] + "out" + "output.psd");
     im.Save(complexFiles[i] + "out" + "output.png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
 }

PSDNET-770. 在 PSD 图像中将任何图像文件作为嵌入式智能对象打开

string sourceFile = Path.Combine(baseFolder, "empty.psd");

string addTreeFile = Path.Combine(baseFolder, "tree.psd");
string addFrostFile = Path.Combine(baseFolder, "frost.png");

string outputTreeFile = Path.Combine(outputFolder, "tree_export.psd");
string outputFrostFile = Path.Combine(outputFolder, "frost_export.psd");

using (var psdImage = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { LoadEffectsResource = true }))
{
    using (Stream stream = new FileStream(addTreeFile, FileMode.Open))
    {
        using (SmartObjectLayer smartLayer = new SmartObjectLayer(stream))
        {
            psdImage.AddLayer(smartLayer);

            psdImage.Save(outputTreeFile, new PsdOptions());                        
        }
    }
}

using (var psdImage = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions() { LoadEffectsResource = true }))
{
    using (Stream stream = new FileStream(addFrostFile, FileMode.Open))
    {
        using (SmartObjectLayer smartLayer = new SmartObjectLayer(stream))
        {
            psdImage.AddLayer(smartLayer);

            psdImage.Save(outputFrostFile, new PsdOptions());
        }
    }
}

PSDNET-1864. Aspose.PSD 插件许可系统

            
    var metered = new Metered();
    metered.SetMeteredKey(pluginPublic, pluginPrivate);
			
	// 插件特定操控