aspose.psd for java
When the psd contains a vector mask, the background is black when exporting to png/jpeg
This is the export result graph
result1.png (48.3 KB)
This is the layer structure
image.png (10.2 KB)
aspose.psd for java
When the psd contains a vector mask, the background is black when exporting to png/jpeg
This is the export result graph
result1.png (48.3 KB)
This is the layer structure
image.png (10.2 KB)
@rofeya could you please provide code sample, input file and the expected result to help us reproduce this issue.
thank you very much
code demo:
PsdImage im = (PsdImage) PsdImage.load(“./demo.psd”);
PngOptions pngOptions = new PngOptions();
pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
im.save(“demo.png”, pngOptions);
input:
Since there is no way to upload psd, I put the input file on github:
The result of executing the code export is that there is a small black block on a white image
My expectation is that the whole picture is white
Very urgent need to solve this problem, hope to get your help
@rofeya I can confirm the issue. I created task for Production Team PSDJAVA-400: Vector Mask on the Group Layer works incorrect. Final image has the black hole but shouldn’t
When it will be fixed you will be notified.
We also encountered another problem, when I replaced the content of the smart layer, the original deformation effect on the smart layer was lost
demo code:
public static byte[] toByteArray(InputStream input) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[1024*4];
int n = 0;
while (-1 != (n = input.read(buffer))) {
output.write(buffer, 0, n);
}
return output.toByteArray();
}
public static void test(String[] args) throws IOException {
PsdImage demo1 = (PsdImage) PsdImage.load("./demo2.psd");
for(int i=0; i < demo1.getLayers().length; i++ )
{
System.out.println(demo1.getLayers()[i].getName());
if ("sucai".equals(demo1.getLayers()[i].getName()) )
{
SmartObjectLayer sucai = (SmartObjectLayer) demo1.getLayers()[i];
String fileName = "./newMaterial.jpg";
InputStream inputStream = new FileInputStream(fileName);
byte[] bytes = toByteArray(inputStream);
sucai.setContents(bytes);
sucai.updateModifiedContent();
inputStream.close();
}
}
PngOptions pngOptions = new PngOptions();
pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
demo1.save("1111-1.psd");
demo1.close();
}
demo :newMaterial.jpg (98.1 KB)
psd demo : https://github.com/rofemen/ssoDemo/blob/master/demo2.psd
expect the result:
1111-1.jpg (51.6 KB)
current effect:
demo3.jpg (49.7 KB)
@rofeya thank you for the provided data. I created additional task PSDJAVA-403: Warp deformation is lost on the Smart Object After Content Replacement
This issue haven’t been resolved in Aspose.PSD for .Net, so it will be added to Aspose.PSD for Java after implementation in .Net