Catatan Rilis Aspose.PSD for .NET 22.7
Contents
[
Hide
]
Halaman ini berisi catatan rilis untuk Aspose.PSD for .NET 22.7
Kunci | Ringkasan | Kategori |
---|---|---|
PSDNET-482 | Dukungan untuk Sumber Bagian Gambar #4000-4999 sumber Plug-In | Fitur |
PSDNET-875 | Terjadi pengecualian yang tidak tertangani dari jenis “System.OutOfMemoryException” di Aspose.PSD.dll | Kesalahan |
PSDNET-1050 | Setelah mengekspor file PSD, hasilnya jauh lebih besar dari file sumber | Kesalahan |
PSDNET-1083 | Data analisis yang salah untuk XmpResource | Kesalahan |
PSDNET-1205 | Setelah diekspor, ukuran file PSD dengan subfolder telah meningkat | Kesalahan |
Perubahan API Publik
API Ditambahkan:
- T:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure
- P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure.Key
- P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure.Length
- P:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure.Items
- M:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure.SaveData(Aspose.PSD.StreamContainer)
- F:Aspose.PSD.FileFormats.Psd.Layers.LayerResources.AnimatedDataSectionStructure.StructureKey
- T:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource
- P:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource.DataSize
- P:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource.MinimalVersion
- P:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource.KeyName
- P:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource.AnimatedDataSection
- M:Aspose.PSD.FileFormats.Psd.Resources.AnimatedDataSectionResource.SaveData(Aspose.PSD.StreamContainer)
API Dihapus:
- Tidak ada
Contoh Penggunaan:
PSDNET-482. Dukungan untuk Sumber Bagian Gambar #4000-4999 sumber Plug-In
// Kode berikut menunjukkan bagaimana mengatur/memperbarui waktu tunda dalam bingkai timeline dari data animasi.
string sourceFile = "3_animated.psd";
string outputPsd = "output_3_animated.psd";
T FindStructure<T>(IEnumerable<OSTypeStructure> structures, string keyName) where T : OSTypeStructure
{
foreach (var structure in structures)
{
if (structure.KeyName.ClassName == keyName)
{
return structure as T;
}
}
return null;
}
OSTypeStructure[] AddOrReplaceStructure(IEnumerable<OSTypeStructure> structures, OSTypeStructure newStructure)
{
List<OSTypeStructure> listOfStructures = new List<OSTypeStructure>(structures);
for (int i = 0; i < listOfStructures.Count; i++)
{
OSTypeStructure structure = listOfStructures[i];
if (structure.KeyName.ClassName == newStructure.KeyName.ClassName)
{
listOfStructures.RemoveAt(i);
break;
}
}
listOfStructures.Add(newStructure);
return listOfStructures.ToArray();
}
using (PsdImage image = (PsdImage)Image.Load(sourceFile))
{
foreach (var imageResource in image.ImageResources)
{
if (imageResource is AnimatedDataSectionResource)
{
var animatedData =
(AnimatedDataSectionStructure) (imageResource as AnimatedDataSectionResource).AnimatedDataSection;
var framesList = FindStructure<ListStructure>(animatedData.Items, "FrIn");
var frame1 = (DescriptorStructure)framesList.Types[1];
// Membuat catatan waktu tunda bingkai dengan nilai 100 centi-detik yang sama dengan 1 detik.
var frameDelay = new IntegerStructure(new ClassID("FrDl"));
frameDelay.Value = 100; // atur waktu dalam centi-detik.
frame1.Structures = AddOrReplaceStructure(frame1.Structures, frameDelay);
break;
}
}
image.Save(outputPsd);
}
PSDNET-875. Terjadi pengecualian yang tidak tertangani dari jenis “System.OutOfMemoryException” di Aspose.PSD.dll
string srcFile = "001-.psd";
string jpgFilePath = "T_0003.jpg";
string outputFilePath = "output_newPsd.psd";
using (var im = (PsdImage)Image.Load(srcFile))
{
using (FileStream fs = new FileStream(jpgFilePath, FileMode.Open))
{
var newLayer = new Aspose.PSD.FileFormats.Psd.Layers.Layer(fs);
newLayer.DisplayName = "NewLayer";
im.AddLayer(newLayer);
im.Save(outputFilePath, true);
}
}
PSDNET-1050. Setelah mengekspor file PSD, hasilnya jauh lebih besar dari file sumber
string src = "ShimadzuLetterhead100.psd";
string output = "output.psd";
using (var img = (PsdImage)Image.Load(src))
{
img.Save(output);
}
double outputSizeMb = new FileInfo(output).Length / 1024d / 1024d;
if (outputSizeMb > 6)
{
throw new Exception("File output lebih besar dari seharusnya.");
}
PSDNET-1083. Data analisis yang salah untuk XmpResource
string inputPsdImagePath = @"input.psd";
string savedPsdImagePath = @"saved.psd";
bool isOriginalContain = false;
bool isSavedContain = false;
// Temukan kunci XMP sub dalam file input
using (PsdImage img = (PsdImage)Image.Load(inputPsdImagePath))
{
foreach (var package in img.XmpData.Packages)
{
foreach (var pack in package)
{
if (pack.Value is XmpArray)
{
XmpArray xmpArray = (XmpArray)pack.Value;
string xmlValue = xmpArray.GetXmlValue();
if (xmlValue.Contains("<photoshop:LayerName>test1</photoshop:LayerName>"))
{
isOriginalContain = true;
break;
}
}
}
if (isOriginalContain)
{
break;
}
}
img.Save(savedPsdImagePath);
}
// Temukan kunci XMP sub dalam file yang disimpan
using (PsdImage img = (PsdImage)Image.Load(savedPsdImagePath))
{
foreach (var package in img.XmpData.Packages)
{
foreach (var pack in package)
{
if (pack.Value is XmpArray)
{
XmpArray xmpArray = (XmpArray)pack.Value;
string xmlValue = xmpArray.GetXmlValue();
if (xmlValue.Contains("<photoshop:LayerName>test1</photoshop:LayerName>"))
{
isSavedContain = true;
break;
}
}
}
if (isSavedContain)
{
break;
}
}
img.Save(savedPsdImagePath);
}
if (isOriginalContain && isSavedContain)
{
// Semuanya baik-baik saja!
}
else
{
throw new Exception("Ini tidak berhasil");
}
PSDNET-1205. Setelah diekspor, ukuran file PSD dengan subfolder telah meningkat
string[] sourceFiles = new string[] { "1lvlFoldersTest.psd", "5lvlFoldersTest.psd"};
foreach (var fileName in sourceFiles)
{
string sourceFilePath = fileName;
string outputFilePath = "output_" + fileName;
using (PsdImage image = (PsdImage)Image.Load(sourceFilePath))
{
image.Save(outputFilePath);
}
double outputSizeMb = new FileInfo(outputFilePath).Length / 1024d / 1024d;
if (outputSizeMb > 1.9)
{
throw new Exception("File output lebih besar dari seharusnya.");
}
}