PsdImage psd = (PsdImage) PsdImage.load(psdPath);可以使用Cache.setExactReallocateOnly(false);
Cache.setCacheType(CacheType.CacheInMemoryOnly);
Cache.setCacheFolder(cachePath);
Cache.setMaxDiskSpaceForCache(Double.valueOf(1102410241024).intValue());
Cache.setMaxMemoryForCache(Double.valueOf(1102410241024).intValue());
缓存吗?
想知道你们有没有中文api文档
关于psd智能替换方面的
java.lang.ArrayIndexOutOfBoundsException: -1
at com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer.a(Unknown Source)
at com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer.a(Unknown Source)
at com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer.replaceContents(Unknown Source)
at com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer.replaceContents(Unknown Source)报这种错误,没法知道具体原因
问题已经解决,谢谢,现在想问下,如果psd文件加载一次怎么实现多次智能图层对象替换,现在加载一次psd文件,多次替换智能对象会报错Cannot remove the data source because the specified uniqueId is not found
你好代码如下:
PsdImage psd = (PsdImage) PsdImage.load("1.psd");
for (Layer layer: psd.getLayers()) {
if(l instanceof SmartObjectLayer){
smartObjectLayer.replaceContents("replace.png");
}
}
psd.save("gen1.png",pngOptions);
for (Layer layer: psd.getLayers()) {
if(l instanceof SmartObjectLayer){
smartObjectLayer.replaceContents("replace1.jpg");
}
}
psd.save("gen2.png",pngOptions);
[1.psd](https://xiaoyi-pro-test.oss-cn-shenzhen.aliyuncs.com/test/202108201444.psd?versionId=CAEQHRiBgIDAoa.J2xciIDRhOGNhMTYyNzJlMzQ0ZmViODIzNzkyM2I2Njk1MjZh)
- replace.png (94.8 KB)
- replace1.jpg (55.2 KB)
We are verifying the issue on our end and will get back with feedback as soon as poosible.
请问什么时候能有反馈呢?
我们需要对此进行调查。 已在我们的问题跟踪系统中创建了 ID 为 PSDJAVA-371 的工单,以进一步调查和解决问题。 此线程已与问题相关联,以便在问题解决后您可能会收到通知。