Aspose.PSD for Java 20.6 - Sürüm Notları
Contents
[
Hide
]
Bu sayfa Aspose.PSD for Java 20.6 için sürüm notlarını içerir.
Anahtar | Özet | Kategori |
---|---|---|
PSDJAVA-216 | LnkEResource’un (Akıllı Nesne Katmanı Kaynağı) Desteklenmesi | Özellik |
PSDJAVA-219 | britResource’un (Tutuluk/Aydınlatma Ayar Katmanı Kaynağı) Desteklenmesi | Özellik |
PSDJAVA-222 | DefaultReplacementFont ayarının ImageOptionsBase sınıfına taşınması | Geliştirme |
PSDJAVA-217 | Maskesi olan ayarlama katmanında PSD dosyalarının yeniden boyutlandırılması yanlış çalışır | Hata |
PSDJAVA-218 | RGB modunda 16 bit/kanal olan Psd Resmi yalnızca ön izlemelerde güncellenir | Hata |
PSDJAVA-220 | PSD Katman Maskelerinde yapılan değişiklikler kaydedilmez | Hata |
PSDJAVA-221 | Boş Katman Grubuna Katman Grubu ekledikten sonra Yanlış Katman Sırası | Hata |
PSDJAVA-223 | AdobeStockLicenseState özelliği olan bileşik LnkE Kaynağı olan belirli PSD dosyasının yüklenmesi sırasında Olay | Hata |
PSDJAVA-224 | AI Dosyasının Jpeg2000 Biçimine Kaydedilmesi Çalışmaz | Hata |
PSDJAVA-225 | Geçiş Yöntemi Olmayan Karışık Karışım Kipi Katman Grubu Rendelenmiyor | Hata |
PSDJAVA-226 | Belirli Psd dosyasını görüntüye dönüştürmeye çalışırken NullReference İstisnası | Hata |
PSDJAVA-227 | Belirli Psd dosyasını açmaya çalışırken OverflowException | Hata |
Genel API Değişiklikleri
Eklenen API’ler:
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.getFileName
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.getFileSize
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.getFullPath
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.getRelativePath
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setAdobeStockId(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setDate(java.util.Date)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setElementName(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setElementRef(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setFileName(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setFileSize(long)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setFullPath(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource.setRelativePath(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getAssetLockedState
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getAssetModTime
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getChildDocId
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getCompId
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getFileCreator
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getFileType
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getLength
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getOriginalCompId
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getOriginalFileName
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getType
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getUniqueId
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.getVersion
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.hasFileOpenDescriptor
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.isLibraryLink
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setAssetLockedState(boolean)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setAssetModTime(double)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setChildDocId(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setCompId(int)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setFileCreator(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setFileOpenDescriptor(boolean)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setFileType(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setLibraryLink(boolean)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setOriginalCompId(int)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setOriginalFileName(java.lang.String)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource.setUniqueId(java.util.UUID)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.getDataSourceCount
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.getLength
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.getPsdVersion
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.getSignature
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.isEmpty
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource.save(com.aspose.psd.StreamContainer,int)
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.Lnk2Resource.#ctor(com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource[])
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.Lnk2Resource.getKey
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LnkeResource.#ctor
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LnkeResource.#ctor(com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource[])
- M:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LnkeResource.getKey
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFdDataSource
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LiFeDataSource
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSource
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkDataSourceType
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LinkResource
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.Lnk2Resource
- T:com.aspose.psd.fileformats.psd.layers.layerresources.linkresources.LnkeResource
Kaldırılan API’ler:
- M:com.aspose.psd.imageloadoptions.PsdLoadOptions.getDefaultReplacementFont
- M:com.aspose.psd.imageloadoptions.PsdLoadOptions.setDefaultReplacementFont(java.lang.String)
Kullanım örnekleri:
PSDJAVA-216: LnkEResource’un Desteklenmesi (Akıllı Nesne Katmanı Kaynağı)
// PSD'ye farklı tiplerde varlıkların (raster görüntüler, CC kitaplıkları) bağlanmasının bir örneği.
// Ayrıca LnkeResource API'si ele alınmıştır.
// Yerel kapsamdaki metodları içeren bir sınıf
class LocalScopeExtension
{
void assertIsTrue(boolean condition)
{
if (!condition)
{
throw new FormatException("ExampleOfLnkEResourceSupport yanlış çalışıyor.");
}
}
void assertAreEqual(Object actual, Object expected)
{
assertIsTrue(actual != null && actual.equals(expected));
}
// Bu örnek, dış bağlantılı bir dosya hakkında bilgi içeren Photoshop Psd LnkE
// Kaynağı üzerindeki özelliklerin nasıl alınıp ayarlanacağını gösterir.
void exampleOfLnkEResourceSupport(
String fileName,
int length,
int length2,
int length3,
int length4,
String fullPath,
String date,
double assetModTime,
String childDocId,
boolean locked,
String uid,
String name,
String originalFileName,
String fileType,
long size)
{
String outputPath = "out_" + fileName;
// Önceden tanımlanmış bir PSD'yi yükle
PsdImage image = (PsdImage)Image.load(fileName);
try
{
// Genel kaynaklar arasında LnkeResource'yi ara
LnkeResource lnkeResource = null;
for (LayerResource resource : image.getGlobalLayerResources())
{
if (resource instanceof LnkeResource)
{
lnkeResource = (LnkeResource)resource;
// LnkeResource özelliklerinin doğru olduğundan emin ol
assertAreEqual(lnkeResource.getLength(), length);
assertAreEqual(lnkeResource.get_Item(0).getUniqueId(), UUID.fromString(uid));
assertAreEqual(lnkeResource.get_Item(0).getFullPath(), fullPath);
assertAreEqual(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(lnkeResource.get_Item(0).getDate()), date);
assertAreEqual(lnkeResource.get_Item(0).getAssetModTime(), assetModTime);
assertAreEqual(lnkeResource.get_Item(0).getAssetLockedState(), locked);
assertAreEqual(lnkeResource.get_Item(0).getFileName(), name);
assertAreEqual(lnkeResource.get_Item(0).getFileSize(), size);
assertAreEqual(lnkeResource.get_Item(0).getChildDocId(), childDocId);
assertAreEqual(lnkeResource.get_Item(0).getVersion(), 7);
assertAreEqual(lnkeResource.get_Item(0).getFileType().trim(), fileType);
assertAreEqual(lnkeResource.get_Item(0).getFileCreator().trim(), "");
assertAreEqual(lnkeResource.get_Item(0).getOriginalFileName(), originalFileName);
assertAreEqual(lnkeResource.get_Item(0).getCompId(), -1);
assertAreEqual(lnkeResource.get_Item(0).getOriginalCompId(), -1);
assertIsTrue(lnkeResource.get_Item(0).hasFileOpenDescriptor());
assertIsTrue(!lnkeResource.isEmpty());
assertIsTrue(lnkeResource.get_Item(0).getType() == LinkDataSourceType.liFE);
// LnkeResource özelliklerini güncelle
lnkeResource.get_Item(0).setFullPath("file:///C:/Aspose/net/Aspose.Psd/test/testdata/Images/Psd/SmartObjects/rgb8_2x2.png");
assertAreEqual(lnkeResource.getLength(), length2);
lnkeResource.get_Item(0).setFileName("rgb8_2x23.png");
assertAreEqual(lnkeResource.getLength(), length3);
lnkeResource.get_Item(0).setChildDocId(UUID.randomUUID().toString());
assertAreEqual(lnkeResource.getLength(), length4);
lnkeResource.get_Item(0).setDate(new Date());
lnkeResource.get_Item(0).setAssetModTime(Double.MAX_VALUE);
lnkeResource.get_Item(0).setFileSize(Long.MAX_VALUE);
lnkeResource.get_Item(0).setFileType("test");
lnkeResource.get_Item(0).setFileCreator("file");
lnkeResource.get_Item(0).setCompId(Integer.MAX_VALUE);
break;
}
}
// LnkeResource'nin desteklendiğinden emin ol
assertIsTrue(lnkeResource != null);
// Yüklenmiş PSD'nin kopyasını kaydet
image.save(outputPath, new PsdOptions(image));
}
finally
{
image.dispose();
}
// Kaydedilen kopyayı yükle
PsdImage image1 = (PsdImage)Image.load(outputPath);
try
{
// PSD'yi PNG dosya biçimine dönüştür (alfa kanalı ile şeffaflık için)
PngOptions pngOptions = new PngOptions();
pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
image1.save(Path.changeExtension(outputPath, "png"), pngOptions);
}
finally
{
image1.dispose();
}
}
}
LocalScopeExtension $ = new LocalScopeExtension();
// Bu örnek, dış bağlantılı JPEG dosyası hakkında bilgi içeren Psd LnkE Kaynağı olan
// Photoshop Psd'nin dış bir JPEG dosyası hakkında bilgi içeren LnkE Kaynağı olan
$.exampleOfLnkEResourceSupport(
"photooverlay_5_new.psd",
0x21c,
0x26c,
0x274,
0x27c,
"file:///C:/Users/cvallejo/Desktop/photo.jpg",
"05/09/2017 22:24:51",
0,
"F062B9DB73E8D124167A4186E54664B0",
false,
"02df245c-36a2-11e7-a9d8-fdb2b61f07a7",
"photo.jpg",
"photo.jpg",
"JPEG",
0x1520d);
// Bu örnek, dış bağlantılı PNG dosyası hakkında bilgi içeren Photoshop Psd'nin LnkE Kaynağı olan
$.exampleOfLnkEResourceSupport(
"rgb8_2x2_linked.psd",
0x284,
0x290,
0x294,
0x2dc,
"file:///C:/Aspose/net/Aspose.Psd/test/testdata/Issues/PSDNET-491/rgb8_2x2.png",
"14/04/2020 14:23:44",
0,
"",
false,
"5867318f-3174-9f41-abca-22f56a75247e",
"rgb8_2x2.png",
"rgb8_2x2.png",
"png",
0x53);
// Bu örnek, dış bağlantılı CC Kitaplıkları Varlığı hakkında bilgi içeren Photoshop Psd LnkE Kaynağı olan
$.exampleOfLnkEResourceSupport(
"rgb8_2x2_asset_linked.psd",
0x398,
0x38c,
0x388,
0x3d0,
"CC Libraries Varlık “rgb8_2x2_linked/rgb8_2x2” (Özellik sadece Photoshop CC 2015'te mevcuttur)",
"01/01/0001 00:00:00",
1588890915488.0d,
"",
false,
"ec15f0a8-7f13-a640-b928-7d29c6e9859c",
"rgb8_2x2_linked",
"rgb8_2x2.png",
"png",
0);
PSDJAVA-219: britResource’un Desteklenmesi (Tutuluk/Aydınlatma Ayar Katmanı Kaynağı)
// Bu Örnek, PSD Görüntüsü Parlaklık/Kontrast Katmanı Kaynağı - BritResource üzerinde programatik olarak değişiklik yapabileceğinizi gösterir. Bu Düşük Seviye Aspose.PSD API'sini kullanabilirsiniz.
// Parlaklık/Kontrast Katmanını API'si üzerinden kullanarak, PSD dosyası içeriği üzerinde daha fazla kontrol elde edebilirsiniz.
String srcPath = "BrightnessContrastPS6.psd";
String dstPath = "BrightnessContrastPS6_output.psd";
// Parlaklık / Kontrast ayarllık Katmanı içeren bir Photoshop belgesini yükler
PsdImage psdImage = (PsdImage)Image.load(srcPath);
try
{
// BritResource'u ara
for (Layer layer : psdImage.getLayers())
{
if (layer instanceof BrightnessContrastLayer)
{
for (LayerResource layerResource : layer.getResources())
{
if (layerResource instanceof BritResource)
{
BritResource resource = (BritResource)layerResource;
// Kaynak özelliklerini doğrula
if (resource.getBrightness() != -40 ||
resource.getContrast() != 10 ||
resource.getLabColor() ||
resource.getMeanValueForBrightnessAndContrast() != 127)
{
throw new RuntimeException("BritResource yanlış okundu");
}
// Kaynak özelliklerini güncelle
resource.setBrightness((short)25);
resource.setContrast((short)-14);
resource.setLabColor(true);
resource.setMeanValueForBrightnessAndContrast((short)200);
// Güncellenmiş PSD'nin kopyasını kaydet
psdImage.save(dstPath, new PsdOptions());
break;
}
}
}
}
}
finally
{
psdImage.dispose();
}
**PSDJAVA-217: Ayarlama katmanında maskesi olan PSD dosyalarının yeniden boyutlandırılması yanlış çalışır**
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"> <span class="c1">// Boş sınırlara sahip ayarlama katmanındaki bir maskeye sahip bir görüntünün yeniden boyutlandırılmasına ilişkin bir örnektir.
</span><span class="c1"></span>
<span class="c1">// Program, herhangi bir istisna olup olmadığını kontrol etmek için önceden tanımlanmış bir PSD yükler.
</span><span class="c1"></span>
<span class="kd">final</span> <span class="kt">int</span> <span class="n">scale</span> <span class="o">=</span> <span class="n">2</span><span class="o">;</span> <span class="c1">// keyfi bir katsayı
</span><span class="c1"></span>
<span class="n">String</span><span class="o">[]</span> <span class="n">names</span> <span class="o">=</span> <span class="o">{</span>
<span class="s">"OneRegularAndOneAdjustmentWithVectorAndLayerMask"</span><span class="o">,</span>
<span class="s">"LevelsLayerWithLayerMaskRgb"</span><span class="o">,</span>
<span class="s">"LevelsLayerWithLayerMaskCmyk"</span><span class="o">,</span>
<span class="o">};</span>
<span class="k">for</span> <span class="o">(</span><span class="n">String</span> <span class="n">name</span> <span class="o">:</span> <span class="n">names</span><span class="o">)</span>
<span class="o">{</span>
<span class="n">String</span> <span class="n">srcFilePath</span> <span class="o">=</span> <span class="n">name</span> <span class="o">+</span> <span class="s">".psd"</span><span class="o">;</span>
<span class="n">String</span> <span class="n">dstFilePath</span> <span class="o">=</span> <span class="s">"output_"</span> <span class="o">+</span> <span class="n">srcFilePath</span><span class="o">;</span>
<span class="n">String</span> <span class="n">dstPngFilePath</span> <span class="o">=</span> <span class="s">"output_"</span> <span class="o">+</span> <span class="n">name</span> <span class="o">+</span> <span class="s">".png"</span><span class="o">;</span>
<span class="c1">// Boş sınırlara sahip bir ayarlama katmanı olan önceden tanımlanmış bir PSD yükleyin
</span><span class="c1"></span>
<span class="n">PsdLoadOptions</span> <span class="n">psdLoadOptions</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PsdLoadOptions</span><span class="o">();</span>
<span class="n">psdLoadOptions</span><span class="o">.</span><span class="na">setLoadEffectsResource</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
<span class="n">PsdImage</span> <span class="n">image</span> <span class="o">=</span> <span class="o">(</span><span class="n">PsdImage</span><span class="o">)</span><span class="n">Image</span><span class="o">.</span><span class="na">load</span><span class="o">(</span><span class="n">srcFilePath</span><span class="o">,</span> <span class="n">psdLoadOptions</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="c1">// Görüntüyü yeniden boyutlandır
</span><span class="c1"></span>
<span class="n">image</span><span class="o">.</span><span class="na">resize</span><span class="o">(</span><span class="n">image</span><span class="o">.</span><span class="na">getWidth</span><span class="o">()</span> <span class="o">*</span> <span class="n">scale</span><span class="o">,</span> <span class="n">image</span><span class="o">.</span><span class="na">getHeight</span><span class="o">()</span> <span class="o">*</span> <span class="n">scale</span><span class="o">);</span>
<span class="c1">// Yüklü PSD'nin kopyasını kaydet
</span><span class="c1"></span>
<span class="n">image</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="n">dstFilePath</span><span class="o">,</span> <span class="k">new</span> <span class="n">PsdOptions</span><span class="o">());</span>
<span class="c1">// PSD'yi PNG dosya biçimine dönüştür (alfa kanalı ile şeffaflık için)
</span><span class="c1"></span>
<span class="n">PngOptions</span> <span class="n">pngOptions</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PngOptions</span><span class="o">();</span>
<span class="n">pngOptions</span><span class="o">.</span><span class="na">setColorType</span><span class="o">(</span><span class="n">PngColorType</span><span class="o">.</span><span class="na">TruecolorWithAlpha</span><span class="o">);</span>
<span class="n">image</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="n">dstPngFilePath</span><span class="o">,</span> <span class="n">pngOptions</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">image</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span>
<span class="o">}</span></code></pre></div>
**PSDJAVA-218: RGB modunda 16 bit/kanal olan Psd Resmi yalnızca ön izlemelerde güncellenir**
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"> <span class="c1">// 16 bit RGB görüntü için düzenli katmanların güncellenmesi hakkında bir örnektir. Program herhangi bir katmanın doğru bir şekilde güncellendiğinden emin olmak için her katmanda bir şeyler çizer.
</span><span class="c1"></span>
<span class="n">String</span> <span class="n">kaynakDosyaYolu</span> <span class="o">=</span> <span class="s">"in.psd"</span><span class="o">;</span>
<span class="n">String</span> <span class="n">ciktiDosyaYolu</span> <span class="o">=</span> <span class="s">"output.psd"</span><span class="o">;</span>
<span class="c1">// 16 bit RGB modunda belirli bir PSD dosyasını yükleyin
</span><span class="c1"></span>
<span class="n">PsdImage</span> <span class="n">image</span> <span class="o">=</span> <span class="o">(</span><span class="n">PsdImage</span><span class="o">)</span><span class="n">Image</span><span class="o">.</span><span class="na">load</span><span class="o">(</span><span class="n">kaynakDosyaYolu</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="k">for</span> <span class="o">(</span><span class="n">Layer</span> <span class="n">layer</span> <span class="o">:</span> <span class="n">image</span><span class="o">.</span><span class="na">getLayers</span><span class="o">())</span>
<span class="o">{</span>
<span class="c1">// Düzenli bir katman için katman adını ve iç çerçeveyi çizer
</span><span class="c1"></span>
<span class="k">if</span> <span class="o">(!(</span><span class="n">layer</span> <span class="k">instanceof</span> <span class="n">LayerGroup</span><span class="o">)</span> <span class="o">&&</span> <span class="o">!(</span><span class="n">layer</span> <span class="k">instanceof</span> <span class="n">AdjustmentLayer</span><span class="o">)</span> <span class="o">&&</span>
<span class="o">(</span><span class="n">layer</span><span class="o">.</span><span class="na">getWidth</span><span class="o">()</span> <span class="o">></span> <span class="n">100</span><span class="o">)</span> <span class="o">&&</span> <span class="o">(</span><span class="n">layer</span><span class="o">.</span><span class="na">getHeight</span><span class="o">()</span> <span class="o">></span> <span class="n">100</span><span class="o">))</span>
<span class="o">{</span>
<span class="n">Graphics</span> <span class="n">graphics</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Graphics</span><span class="o">(</span><span class="n">layer</span><span class="o">);</span>
<span class="n">graphics</span><span class="o">.</span><span class="na">drawString</span><span class="o">(</span><span class="n">layer</span><span class="o">.</span><span class="na">getName</span><span class="o">(),</span> <span class="k">new</span> <span class="n">Font</span><span class="o">(</span><span class="s">"Arial"</span><span class="o">,</span> <span class="n">10</span><span class="o">),</span>
<span class="k">new</span> <span class="n">SolidBrush</span><span class="o">(</span><span class="n">Color</span><span class="o">.</span><span class="na">getRed</span><span class="o">()),</span> <span class="n">15</span><span class="o">,</span> <span class="n">45</span><span class="o">);</span>
<span class="n">graphics</span><span class="o">.</span><span class="na">drawRectangle</span><span class="o">(</span><span class="k">new</span> <span class="n">Pen</span><span class="o">(</span><span class="n">Color</span><span class="o">.</span><span class="na">getRed</span><span class="o">()),</span> <span class="k">new</span> <span class="n">Rectangle</span><span class="o">(</span><span class="n">30</span><span class="o">,</span> <span class="n">10</span><span class="o">,</span> <span class="n">40</span><span class="o">,</span> <span class="n">80</span><span class="o">));</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="c1">// Yüklü PSD'nin kopyasını kaydet
</span><span class="c1"></span>
<span class="n">image</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="n">ciktiDosyaYolu</span><span class="o">,</span> <span class="k">new</span> <span class="n">PsdOptions</span><span class="o">(</span><span class="n">image</span><span class="o">));</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">image</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span></code></pre></div>
**PSDJAVA-220: PSD Katman Maskelerinde yapılan değişiklikler kaydedilmez**
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"> <span class="c1">// Yerel kapsamdaki metodları içeren bir sınıf
</span><span class="c1"></span>
<span class="kd">class</span> <span class="nc">LocalScopeExtension</span>
<span class="o">{</span>
<span class="kt">void</span> <span class="nf">assertAreEqual</span><span class="o">(</span><span class="n">Object</span> <span class="n">actual</span><span class="o">,</span> <span class="n">Object</span> <span class="n">expected</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">if</span> <span class="o">(!(</span><span class="n">actual</span> <span class="o">!=</span> <span class="kc">null</span> <span class="o">&&</span> <span class="n">actual</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">expected</span><span class="o">)))</span>
<span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">FormatException</span><span class="o">(</span><span class="s">"Örnek yanlış çalışıyor."</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="c1">// Byte'ın büyük uçta sıralanması
</span><span class="c1"></span>
<span class="kt">byte</span><span class="o">[]</span> <span class="nf">getBigEndianBytesInt32</span><span class="o">(</span><span class="kt">int</span> <span class="n">value</span><span class="o">)</span>
<span class="o">{</span>
<span class="kt">byte</span><span class="o">[]</span> <span class="n">bytes</span> <span class="o">=</span> <span class="k">new</span> <span class="kt">byte</span><span class="o">[</span><span class="n">4</span><span class="o">];</span>
<span class="n">bytes</span><span class="o">[</span><span class="n">0</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="kt">byte</span><span class="o">)((</span><span class="n">value</span> <span class="o">>></span> <span class="n">24</span><span class="o">)</span> <span class="o">&</span> <span class="n">0x000000FF</span><span class="o">);</span>
<span class="n">bytes</span><span class="o">[</span><span class="n">1</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="kt">byte</span><span class="o">)((</span><span class="n">value</span> <span class="o">>></span> <span class="n">16</span><span class="o">)</span> <span class="o">&</span> <span class="n">0x000000FF</span><span class="o">);</span>
<span class="n">bytes</span><span class="o">[</span><span class="n">2</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="kt">byte</span><span class="o">)((</span><span class="n">value</span> <span class="o">>></span> <span class="n">8</span><span class="o">)</span> <span class="o">&</span> <span class="n">0x000000FF</span><span class="o">);</span>
<span class="n">bytes</span><span class="o">[</span><span class="n">3</span><span class="o">]</span> <span class="o">=</span> <span class="o">(</span><span class="kt">byte</span><span class="o">)</span><span class="n">value</span><span class="o">;</span>
<span class="k">return</span> <span class="n">bytes</span><span class="o">;</span>
<span class="o">}</span>
<span class="c1">// Dizi içindeki büyük uçtan Int32'ye dönüştürülen değeri alır
</span><span class="c1"></span>
<span class="kt">int</span> <span class="nf">fromBigEndianToInt32</span><span class="o">(</span><span class="kt">byte</span><span class="o">[]</span> <span class="n">bytes</span><span class="o">,</span> <span class="kt">int</span> <span class="n">index</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">if</span> <span class="o">(</span><span class="n">bytes</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">ArgumentNullException</span><span class="o">(</span><span class="s">"bytes"</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">if</span> <span class="o">(</span><span class="n">index</span> <span class="o"><</span> <span class="n">0</span> <span class="o">||</span> <span class="n">index</span> <span class="o">+</span> <span class="n">4</span> <span class="o">></span> <span class="n">bytes</span><span class="o">.</span><span class="na">length</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">ArgumentOutOfRangeException</span><span class="o">(</span><span class="s">"index"</span><span class="o">,</span> <span class="s">"İndeks, bayt dizisi dışında düşmektedir."</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">return</span> <span class="o">((</span><span class="n">bytes</span><span class="o">[</span><span class="n">index</span><span class="o">]</span> <span class="o">&</span> <span class="n">0xff</span><span class="o">)</span> <span class="o"><<</span> <span class="n">24</span><span class="o">)</span> <span class="o">|</span> <span class="o">((</span><span class="n">bytes</span><span class="o">[</span><span class="n">index</span> <span class="o">+</span> <span class="n">1</span><span class="o">]</span> <span class="o">&</span> <span class="n">0xff</span><span class="o">)</span> <span class="o"><<</span> <span class="n">16</span><span class="o">)</span> <span class="o">|</span>
<span class="o">((</span><span class="n">bytes</span><span class="o">[</span><span class="n">index</span> <span class="o">+</span> <span class="n">2</span><span class="o">]</span> <span class="o">&</span> <span class="n">0xff</span><span class="o">)</span> <span class="o"><<</span> <span class="n">8</span><span class="o">)</span> <span class="o">|</span> <span class="o">(</span><span class="n">bytes</span><span class="o">[</span><span class="n">index</span> <span class="o">+</span> <span class="n">3</span><span class="o">]</span> <span class="o">&</span> <span class="n">0xff</span><span class="o">);</span>
<span class="o">}</span>
<span class="c1">// Psd görüntüsünden bir raster maske alır ve dosyaya kaydeder
</span><span class="c1"></span>
<span class="kt">void</span> <span class="nf">saveRasterMask</span><span class="o">(</span><span class="n">String</span> <span class="n">maskFilePath</span><span class="o">,</span> <span class="n">Layer</span> <span class="n">layer</span><span class="o">)</span>
<span class="o">{</span>
<span class="n">LayerMaskDataShort</span> <span class="n">maskData</span> <span class="o">=</span> <span class="o">(</span><span class="n">LayerMaskDataShort</span><span class="o">)</span><span class="n">layer</span><span class="o">.</span><span class="na">getLayerMaskData</span><span class="o">();</span>
<span class="n">FileStreamContainer</span> <span class="n">container</span> <span class="o">=</span> <span class="n">FileStreamContainer</span><span class="o">.</span><span class="na">createFileStream</span><span class="o">(</span><span class="n">maskFilePath</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">getBigEndianBytesInt32</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getTop</span><span class="o">()));</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">getBigEndianBytesInt32</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getLeft</span><span class="o">()));</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">getBigEndianBytesInt32</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getBottom</span><span class="o">()));</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">getBigEndianBytesInt32</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getRight</span><span class="o">()));</span>
<span class="n">container</span><span class="o">.</span><span class="na">writeByte</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getDefaultColor</span><span class="o">());</span>
<span class="n">container</span><span class="o">.</span><span class="na">writeByte</span><span class="o">((</span><span class="kt">byte</span><span class="o">)</span><span class="n">maskData</span><span class="o">.</span><span class="na">getFlags</span><span class="o">());</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">getBigEndianBytesInt32</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getImageData</span><span class="o">().</span><span class="na">length</span><span class="o">));</span>
<span class="n">container</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getImageData</span><span class="o">(),</span> <span class="n">0</span><span class="o">,</span> <span class="n">maskData</span><span class="o">.</span><span class="na">getImageData</span><span class="o">().</span><span class="na">length</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">container</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="c1">// Bir dosyadan katmana raster bir maskel ekler ve psd biçimli görüntüyü kaydeder
</span><span class="c1"></span>
<span class="kt">void</span> <span class="nf">addRasterMask</span><span class="o">(</span><span class="n">Layer</span> <span class="n">layer</span><span class="o">,</span> <span class="n">String</span> <span class="n">maskSourcePath</span><span class="o">)</span>
<span class="o">{</span>
<span class="n">LayerMaskDataShort</span> <span class="n">maskData</span> <span class="o">=</span> <span class="k">new</span> <span class="n">LayerMaskDataShort</span><span class="o">();</span>
<span class="n">FileStreamContainer</span> <span class="n">container</span> <span class="o">=</span> <span class="n">FileStreamContainer</span><span class="o">.</span><span class="na">openFileStream</span><span class="o">(</span><span class="n">maskSourcePath</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="kt">byte</span><span class="o">[]</span> <span class="n">bytes</span> <span class="o">=</span> <span class="k">new</span> <span class="kt">byte</span><span class="o">[</span><span class="n">22</span><span class="o">];</span>
<span class="n">assertAreEqual</span><span class="o">(</span><span class="n">container</span><span class="o">.</span><span class="na">read</span><span class="o">(</span><span class="n">bytes</span><span class="o">),</span> <span class="n">22</span><span class="o">);</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setTop</span><span class="o">(</span><span class="n">fromBigEndianToInt32</span><span class="o">(</span><span class="n">bytes</span><span class="o">,</span> <span class="n">0</span><span class="o">));</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setLeft</span><span class="o">(</span><span class="n">fromBigEndianToInt32</span><span class="o">(</span><span class="n">bytes</span><span class="o">,</span> <span class="n">4</span><span class="o">));</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setBottom</span><span class="o">(</span><span class="n">fromBigEndianToInt32</span><span class="o">(</span><span class="n">bytes</span><span class="o">,</span> <span class="n">8</span><span class="o">));</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setRight</span><span class="o">(</span><span class="n">fromBigEndianToInt32</span><span class="o">(</span><span class="n">bytes</span><span class="o">,</span> <span class="n">12</span><span class="o">));</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setDefaultColor</span><span class="o">(</span><span class="n">bytes</span><span class="o">[</span><span class="n">16</span><span class="o">]);</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setFlags</span><span class="o">(</span><span class="n">bytes</span><span class="o">[</span><span class="n">17</span><span class="o">]);</span>
<span class="kt">int</span> <span class="n">imageDataLength</span> <span class="o">=</span> <span class="n">fromBigEndianToInt32</span><span class="o">(</span><span class="n">bytes</span><span class="o">,</span> <span class="n">18</span><span class="o">);</span>
<span class="kt">byte</span><span class="o">[]</span> <span class="n">data</span> <span class="o">=</span> <span class="k">new</span> <span class="kt">byte</span><span class="o">[</span><span class="n">imageDataLength</span><span class="o">];</span>
<span class="n">assertAreEqual</span><span class="o">(</span><span class="n">maskData</span><span class="o">.</span><span class="na">getMaskRectangle</span><span class="o">().</span><span class="na">getWidth</span><span class="o">()</span> <span class="o">*</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">getMaskRectangle</span><span class="o">().</span><span class="na">getHeight</span><span class="o">(),</span> <span class="n">imageDataLength</span><span class="o">);</span>
<span class="n">assertAreEqual</span><span class="o">(</span><span class="n">container</span><span class="o">.</span><span class="na">read</span><span class="o">(</span><span class="n">data</span><span class="o">),</span> <span class="n">imageDataLength</span><span class="o">);</span>
<span class="n">maskData</span><span class="o">.</span><span class="na">setImageData</span><span class="o">(</span><span class="n">data</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">container</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span>
<span class="c1">// Yalnızca katman Maske Verisini eklemek, kanalların güncellenmesi için yeterli değildir;
</span><span class="c1"></span>
<span class="c1">// layer.setLayerMaskData(mask); // Bu, maske kanalını eklemiyor
</span><span class="c1"></span>
<span class="c1">// Maskı ekle (veya güncelle)
</span><span class="c1"></span>
<span class="n">layer</span><span class="o">.</span><span class="na">addLayerMask</span><span class="o">(</span><span class="n">maskData</span><span class="o">);</span> <span class="c1">// Ancak bu hem maskeleri hem de kanalları ekler/günceller!
</span><span class="c1"></span>
<span class="o">}</span>
<span class="o">}</span>
<span class="n">LocalScopeExtension</span> <span class="n">$</span> <span class="o">=</span> <span class="k">new</span> <span class="n">LocalScopeExtension</span><span class="o">();</span>
<span class="c1">// Bu örnek, dış bir JPEG dosyası hakkında bir Psd dosyasının LnkE Kaynağını bilgi içerecek şekilde
</span><span class="c1"></span>
<span class="n">$</span><span class="o">.</span><span class="na">addRasterMask</span><span class="o">(</span><span class="n">layer</span><span class="o">,</span> <span class="s">"raster.msk"</span><span class="o">);</span>
<span class="n">image</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="s">"FourWithMasksAdded2.png"</span><span class="o">,</span> <span class="n">pngOptions</span><span class="o">);</span>
<span class="n">image</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="s">"FourWithMasksAdded2.psd"</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">image</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span></code></pre></div>
**PSDJAVA-221: Boş Katman Grubuna Katman Grubu ekledikten sonra Yanlış Katman Sırası**
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"> <span class="c1">// Bu örnek, programatik olarak bir PSD'ye iç içe bir katman grubu ekleme işlemini gösterir.
</span><span class="c1"></span>
<span class="n">String</span> <span class="n">dstPsdYolu</span> <span class="o">=</span> <span class="s">"output.psd"</span><span class="o">;</span>
<span class="c1">// Çalışılacak bir görüntü oluştur
</span><span class="c1"></span>
<span class="n">PsdImage</span> <span class="n">psdImage</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PsdImage</span><span class="o">(</span><span class="n">1</span><span class="o">,</span> <span class="n">1</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="c1">// Bir üst katman grubu ekleyin ("true", grup katmanını başlangıçta açması anlamına gelir)
</span><span class="c1"></span>
<span class="n">LayerGroup</span> <span class="n">group1</span> <span class="o">=</span> <span class="n">psdImage</span><span class="o">.</span><span class="na">addLayerGroup</span><span class="o">(</span><span class="s">"Grup 1"</span><span class="o">,</span> <span class="n">0</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
<span class="c1">// İç içe bir katman grubu ekleyin
</span><span class="c1"></span>
<span class="n">LayerGroup</span> <span class="n">group2</span> <span class="o">=</span> <span class="n">group1</span><span class="o">.</span><span class="na">addLayerGroup</span><span class="o">(</span><span class="s">"Grup 2"</span><span class="o">,</span> <span class="n">0</span><span class="o">);</span>
<span class="k">if</span> <span class="o">(</span><span class="n">group1</span><span class="o">.</span><span class="na">getLayers</span><span class="o">().</span><span class="na">length</span> <span class="o">!=</span> <span class="n">2</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">RuntimeException</span><span class="o">(</span><span class="s">"Grup 1, Grup 2'nin iki katmanını içermelidir."</span><span class="o">);</span>
<span class="o">}</span>
<span class="c1">// Yalnızca yeni oluşturulan katman gruplarını kaydetmeye çalışarak hiçbir istisna olmadığını doğrulayın
</span><span class="c1"></span>
<span class="n">psdImage</span><span class="o">.</span><span class="na">save</span><span class="o">(</span><span class="n">dstPsdYolu</span><span class="o">);</span>
<span class="o">}</span>
<span class="k">finally</span>
<span class="o">{</span>
<span class="n">psdImage</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
<span class="o">}</span></code></pre></div>
**PSDJAVA-223: AdobeStockLicenseState özelliği olan bileşik LnkE Kaynağı olan belirli PSD dosyasının yüklenmesi sırasında Olay**
<div class="highlight"><pre class="chroma"><code class="language-java" data-lang="java"> <span class="c1">// Bu örnek, Adobe® Photoshop® harici bağlantı kaynağını (LnkeResource) programatik olarak okuyup değiştirmenizi gösterir.
</span><span class="c1"></span>
<span class="c1">// Yerel kapsamdaki metodları içeren bir sınıf
</span><span class="c1"></span>
<span class="kd">class</span> <span class="nc">LocalScopeExtension</span>
<span class="o">{</span>
<span class="kt">void</span> <span class="nf">assertIsTrue</span><span class="o">(</span><span class="kt">boolean</span> <span class="n">condition</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">if</span> <span class="o">(!</span><span class="n">condition</span><span class="o">)</span>
<span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">FormatException</span><span class="o">(</span><span class="s">"Örnek yanlış çalışıyor."</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="kt">void</span> <span class="nf">assertAreEqual</span><span class="o">(</span><span class="n">Object</span> <span class="n">actual</span><span class="o">,</span> <span class="n">Object</span> <span class="n">expected</span><span class="o">)</span>
<span class="o">{</span>
<span class="n">assertIsTrue</span><span class="o">(</span><span class="n">actual</span> <span class="o">!=</span> <span class="kc">null</span> <span class="o">&&</span> <span class="n">actual</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span><span class="n">expected</span><span class="o">));</span>
<span class="o">}</span>
<span class="kt">void</span> <span class="nf">exampleOfComplexLnkEResourceSupport</span><span class="o">(</span><span class="n">String</span> <span class="n">srcPsdPath</span><span class="o">,</span> <span class="kt">int</span> <span class="n">length</span><span class="o">,</span> <span class="kt">int</span> <span class="n">length2</span><span class="o">,</span> <span class="n">Object</span><span class="o">[]</span> <span class="n">dataSourceExpectedValues</span><span class="o">)</span>
<span class="o">{</span>
<span class="c1">// Birden çok veri kaynağı okuyan LayerResource içeren önceden tanımlanmış bir PSD'yi yükler
</span><span class="c1"></span>
<span class="n">PsdImage</span> <span class="n">image</span> <span class="o">=</span> <span class="o">(</span><span class="n">PsdImage</span><span class="o">)</span><span class="n">Image</span><span class="o">.</span><span class="na">load</span><span class="o">(</span><span class="n">srcPsdPath</span><span class="o">);</span>
<span class="k">try</span>
<span class="o">{</span>
<span class="c1">// LnkeResource ara
</span><span class="c1"></span>
<span class="n">LnkeResource</span></code></pre></div>