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.

Hi, has this issue been resolved?

@rofeya according to the status this issue wasn’t fixed. I increased priority.

Hi, is there any progress?

@rofeya we are working on Smart Objects’ features and transformations, before we can start work on this task, we need to finish adding of the Correct Smart Object Transformation Rendering. It’s possible that Aspose.PSD team will fix this issue in Release 23.2-23.3

Is it the 23 of the java version, or the 23 of .NET will be updated

@rofeya

At least in .Net Version it will be updated. If the Java will be released, then it will contain this updates too.

alright, thank you very much

Will this problem be resolved in this version in March?

@rofeya it’s possible that the issue has been fixed in Aspose.PSD for .Net 23.2 already. But we didn’t check it on your example. Also, we are working on the release of Aspose.PSD for Java. It will be released in 1-2 months.
If you want to check it by yourself in .Net, please try to load psd files with this property AllowWarpRepaint = true
Here is example from our Aspose.PSD Release notes.

string sourceFile = "source.psd";
string pngWarpedExport = "warped.png";
string psdWarpedExport = "warpFile.psd";
var warpLoadOptions = new PsdLoadOptions() { AllowWarpRepaint = true };

using (var image = (PsdImage)Image.Load(sourceFile, warpLoadOptions))
{
    image.Save(pngWarpedExport, new PngOptions());
    image.Save(psdWarpedExport, new PsdOptions());
}