Aspose.PSD for .NET 21.2 - リリースノート
Contents
[
Hide
]
このページには、Aspose.PSD for .NET 21.2 のリリースノートが含まれています。
キー | 概要 | カテゴリ |
---|---|---|
PSDNET-404 | vogkResource のサポート | 機能 |
PSDNET-809 | 異なる寸法と解像度を持つファイルでスマートオブジェクト内容を置換すると、スマートオブジェクトレイヤーの境界が正しくない | 機能 |
PSDNET-752 | FillLayer を SmartObjectLayer に変換できないエラー | バグ |
PSDNET-778 | LayerGroup が逆順で新しいレイヤーを追加する | バグ |
PSDNET-790 | SmartObject レイヤーに画像をインポートすると、PSD が破損する | バグ |
PSDNET-810 | ファイルを読み込む際の例外 | バグ |
PSDNET-824 | シェイプレイヤーとベクターパスを持つ PSD 画像を読み込んで保存した後の vogk リソースが正しくない | バグ |
PSDNET-827 | ReferenceStructure および EnumeratedReferenceStructure 構造を読み込む際の例外 | バグ |
パブリック API の変更
追加された API:
- M:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.#ctor
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.OriginType
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.OriginResolution
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.OriginShapeBox
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.OriginRadiiRectangle
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsShapeInvalidatedPresent
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsOriginIndexPresent
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsOriginTypePresent
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsOriginResolutionPresent
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsOriginRadiiRectanglePresent
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeOriginSettings.IsOriginShapeBBoxPresent
- T:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox
- M:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.#ctor
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.Left
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.Top
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.Right
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.Bottom
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.QuadVersion
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeBoundingBox.Bounds
- T:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle
- M:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.#ctor
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.TopLeft
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.TopRight
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.BottomRight
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.BottomLeft
- P:Aspose.PSD.FileFormats.Core.VectorPaths.VectorShapeRadiiRectangle.QuadVersion
- M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.ClassID.#ctor(System.String,System.Boolean)
- M:Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.ReplaceContents(Aspose.PSD.Image,Aspose.PSD.ResolutionSetting)
- M:Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.ReplaceContents(System.String,Aspose.PSD.ResolutionSetting)
削除された API:
- なし
使用例:
PSDNET-404. Support of vogkResource
// この例では、シェイプレイヤーとベクターパスを持つ PSD 画像の正しい読み込みと保存をデモンストレーションしています。
string dataDir = "PSDNET404_1";
string sourcePath = Path.Combine(dataDir, "vectorShapes.psd");
string outputFilePath = Path.Combine(dataDir, "output_vectorShapes.psd");
using (PsdImage image = (PsdImage)Image.Load(sourcePath))
{
var resource = GetVogkResource(image);
AssertAreEqual(1, resource.ShapeOriginSettings.Length);
var setting = resource.ShapeOriginSettings[0];
AssertAreEqual(true, setting.IsOriginIndexPresent);
AssertAreEqual(false, setting.IsShapeInvalidatedPresent);
AssertAreEqual(true, setting.IsOriginResolutionPresent);
AssertAreEqual(true, setting.IsOriginTypePresent);
AssertAreEqual(true, setting.IsOriginShapeBBoxPresent);
AssertAreEqual(false, setting.IsOriginRadiiRectanglePresent);
AssertAreEqual(0, setting.OriginIndex);
var originalSetting = resource.ShapeOriginSettings[0];
originalSetting.IsShapeInvalidated = true;
resource.ShapeOriginSettings = new[]
{
originalSetting,
new VectorShapeOriginSettings()
{
OriginIndex = 1,
OriginResolution = 144,
OriginType = 4,
OriginShapeBox = new VectorShapeBoundingBox()
{
Bounds = Rectangle.FromLeftTopRightBottom(10, 15, 40, 70)
}
},
new VectorShapeOriginSettings()
{
OriginIndex = 2,
OriginResolution = 301,
OriginType = 5,
OriginRadiiRectangle = new VectorShapeRadiiRectangle()
{
TopLeft = 2,
TopRight = 6,
BottomLeft = 23,
BottomRight = 42,
QuadVersion = 1
}
}
};
image.Save(outputFilePath, new PsdOptions());
}
using (PsdImage image = (PsdImage)Image.Load(outputFilePath))
{
var resource = GetVogkResource(image);
AssertAreEqual(3, resource.ShapeOriginSettings.Length);
var setting = resource.ShapeOriginSettings[0];
AssertAreEqual(true, setting.IsOriginIndexPresent);
AssertAreEqual(true, setting.IsShapeInvalidatedPresent);
AssertAreEqual(true, setting.IsOriginResolutionPresent);
AssertAreEqual(true, setting.IsOriginTypePresent);
AssertAreEqual(true, setting.IsOriginShapeBBoxPresent);
AssertAreEqual(false, setting.IsOriginRadiiRectanglePresent);
AssertAreEqual(0, setting.OriginIndex);
AssertAreEqual(true, setting.IsShapeInvalidated);
setting = resource.ShapeOriginSettings[1];
AssertAreEqual(true, setting.IsOriginIndexPresent);
AssertAreEqual(false, setting.IsShapeInvalidatedPresent);
AssertAreEqual(true, setting.IsOriginResolutionPresent);
AssertAreEqual(true, setting.IsOriginTypePresent);
AssertAreEqual(true, setting.IsOriginShapeBBoxPresent);
AssertAreEqual(false, setting.IsOriginRadiiRectanglePresent);
AssertAreEqual(1, setting.OriginIndex);
AssertAreEqual(144.0, setting.OriginResolution);
AssertAreEqual(4, setting.OriginType);
AssertAreEqual(Rectangle.FromLeftTopRightBottom(10, 15, 40, 70), setting.OriginShapeBox.Bounds);
setting = resource.ShapeOriginSettings[2];
AssertAreEqual(true, setting.IsOriginIndexPresent);
AssertAreEqual(false, setting.IsShapeInvalidatedPresent);
AssertAreEqual(true, setting.IsOriginResolutionPresent);
AssertAreEqual(true, setting.IsOriginTypePresent);
AssertAreEqual(false, setting.IsOriginShapeBBoxPresent);
AssertAreEqual(true, setting.IsOriginRadiiRectanglePresent);
AssertAreEqual(2, setting.OriginIndex);
AssertAreEqual(301.0, setting.OriginResolution);
AssertAreEqual(5, setting.OriginType);
AssertAreEqual(2.0, setting.OriginRadiiRectangle.TopLeft);
AssertAreEqual(6.0, setting.OriginRadiiRectangle.TopRight);
AssertAreEqual(23.0, setting.OriginRadiiRectangle.BottomLeft);
AssertAreEqual(42.0, setting.OriginRadiiRectangle.BottomRight);
AssertAreEqual(1, setting.OriginRadiiRectangle.QuadVersion);
}
VogkResource GetVogkResource(PsdImage image)
{
var layer = image.Layers[1];
VogkResource resource = null;
var resources = layer.Resources;
for (int i = 0; i < resources.Length; i++)
{
if (resources[i] is VogkResource)
{
resource = (VogkResource)resources[i];
break;
}
}
if (resource == null)
{
throw new Exception("VogkResource not found.");
}
return resource;
}
void AssertAreEqual(object expected, object actual, string message = null)
{
if (!object.Equals(expected, actual))
{
throw new FormatException(message ?? "Objects are not equal.");
}
}
PSDNET-752. FillLayer を SmartObjectLayer に変換できないエラー
string sourceFilePath = "effectlost.psd";
string outputFilePath = "output.psd";
using (PsdImage psdImage = (PsdImage)Aspose.PSD.Image.Load(sourceFilePath))
{
SmartObjectLayer smartObject = psdImage.SmartObjectProvider.ConvertToSmartObject(0);
psdImage.Save(outputFilePath);
}
PSDNET-778. 逆順に新しいレイヤーを追加すると LayerGroup が逆順に新しいレイヤーを追加する
void AreEqual(string expected, string actual)
{
if (!object.Equals(expected, actual))
{
throw new Exception("値が等しくありません。");
}
}
string outputFile = "output.psd";
PsdOptions psdOptions = new PsdOptions();
psdOptions.Source = new StreamSource(new MemoryStream());
using (PsdImage psdImage = (PsdImage)Image.Create(psdOptions, 100, 100))
{
LayerGroup layerGroup = psdImage.AddLayerGroup("フォルダー", 0, true);
layerGroup.AddLayer(new Layer() { DisplayName = "レイヤー 1" });
layerGroup.AddLayer(new Layer() { DisplayName = "レイヤー 2" });
AreEqual("レイヤー 1", layerGroup.Layers[0].DisplayName);
AreEqual("レイヤー 2", layerGroup.Layers[1].DisplayName);
psdImage.Save(outputFile);
}
PSDNET-790. SmartObject レイヤーに画像をインポートすると PSD が破損する
const string baseFolder = "PSDNET790_1\\";
const string outputFolder = baseFolder + "output\\";
// 画像からインポートされたレイヤーがスマートオブジェクトレイヤーに変換され、保存された PSD ファイルが正しいことをテストします。
using (PsdImage image = (PsdImage)Image.Load(baseFolder + @"layerTest1.psd"))
{
string layerFilePath = baseFolder + @"picture.jpg";
string outputFilePath = outputFolder + "layerTest2.psd";
string outputPngFilePath = Path.ChangeExtension(outputFilePath, ".png");
using (var stream = new FileStream(layerFilePath, FileMode.Open))
{
Layer layer = null;
try
{
layer = new Layer(stream);
image.AddLayer(layer);
}
catch (Exception)