We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PSD中智能对象替换图片后,变形的操作信息丢失?

PSD中智能对象替换图片后,为什么变形的内容丢失了
如下截图为psd文件截屏2021-11-08 下午4.20.20.jpg (128.6 KB)
第二张是生成的图片,替换之后,缩放,位置,扭曲,的信息还在,但变形的信息丢失了
最终成品副本.jpg (302.1 KB)

import com.aspose.psd.fileformats.png.PngColorType;
import com.aspose.psd.fileformats.psd.PsdImage;
import com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer;
import com.aspose.psd.imageoptions.PngOptions;

import java.io.FileNotFoundException;

public class Test3 {
public Test3() {
}
public static void main(String[] args) throws FileNotFoundException {
String png2OutputPath = “/Users/zhouhetao/Downloads/最终成品.png”;
PsdImage psdImage = (PsdImage) PsdImage.load("/Users/zhouhetao/Downloads/PS模板2.psd");
PngOptions pngOptions1 = new PngOptions();
pngOptions1.setColorType(PngColorType.TruecolorWithAlpha);

    String linkOutputPath2="/Users/zhouhetao/Downloads/目标条码.jpg";
    SmartObjectLayer smartObjectLayer = (SmartObjectLayer) psdImage.getLayers()[psdImage.getLayers().length - 1];
    smartObjectLayer.replaceContents(linkOutputPath2);
    psdImage.save(png2OutputPath, pngOptions1);
    psdImage.dispose();
}

}

@kungfupan

Hello,

Could you please write me what’s Aspose.PSD Version is used In your example?
Could you please provide the source file PS模板2.psd

We need to make an investigation, and additional information will be useful.

Was created an issue: PSDNET-1028. After the replacement of a smart object in the PSD, the starting transformation (complex smart object deformation) is lost.

Thank you.

Automatic translate:

你好,

你能告诉我在你的例子中使用了什么 Aspose.PSD 版本吗?
能否提供源文件PS模板2.psd

我们需要进行调查,额外的信息将是有用的ю。

创建了一个问题:PSDNET-1028。 PSD中的智能对象替换后,开始的变换(复杂智能对象变形)丢失。

谢谢你。

我用的是21.7的版本,psd文件如下PS模板6.psd.zip (4.3 MB)

你好,我想要达到是这种效果未标题-1.jpg (446.8 KB)

Thank you for the provided files. We will make investigation and let you know about our results.