Pattern Overlay not supported

The attached zip has a single PSD file, that file has a single text layer, that layer has a simple pattern overlay.
input.zip (525.4 KB)

Saving this kind of files (with a pattern overlay in a text layer) outputs a broken PSD (cannot be opened with Photoshop). No exceptions.
Please advise.

Code sample:

new License().SetLicense("XXXX");
using (PsdImage psd = (PsdImage)PsdImage.Load("input.psd"))
{
    psd.Save("output.psd");
}

Aspose.PSD version 25.4.0
Photoshop version 26.5.0

@gonzalo.gatti.ethofy

It appears that you are encountering issues when saving a PSD file that contains a pattern overlay in a text layer, resulting in a corrupted file that cannot be opened in Photoshop. Unfortunately, the current version of Aspose.PSD you are using (25.4.0) may not fully support saving certain effects, such as pattern overlays, which can lead to this kind of problem.

To work around this issue, you might consider the following steps:

  1. Check for Updates: Ensure you are using the latest version of Aspose.PSD, as newer versions may include bug fixes and improved support for various PSD features, including layer effects.

  2. Modify the Pattern Overlay: If you have control over the pattern overlay settings, you could try modifying or removing the pattern overlay before saving the file. This may help in avoiding the corruption issue.

  3. Use Example Code: You can refer to example code that demonstrates how to work with pattern overlays. For instance, the code snippet below shows how to create and modify a pattern overlay effect:

    PsdLoadOptions loadOptions = new PsdLoadOptions();
    loadOptions.setLoadEffectsResource(true);
    PsdImage psdImage = (PsdImage)Image.load("input.psd", loadOptions);
    
    // Assuming the pattern overlay is on the second layer
    PatternOverlayEffect patternOverlay = (PatternOverlayEffect)psdImage.getLayers()[1].getBlendingOptions().getEffects()[0];
    // Modify the pattern overlay settings as needed
    patternOverlay.setOpacity((byte)193);
    // Save the modified PSD
    psdImage.save("output.psd");
    
  4. Contact Support: If the issue persists, consider reaching out to Aspose support for further assistance. They may provide insights or workarounds specific to your case.

If you continue to experience issues, please provide additional details about the specific settings of the pattern overlay or any error messages you encounter, as this information can help in diagnosing the problem more effectively.

For further reference, you can explore the example of adding pattern effects in the Aspose.PSD documentation, which may provide additional insights into handling such scenarios.

Sources:
[1]: AddPatternEffects.java

Adding it’s .Net equivalent

...
PsdLoadOptions loadOptions = new PsdLoadOptions();
loadOptions.LoadEffectsResource = true;
using (PsdImage psd = (PsdImage)PsdImage.Load("input.psd", loadOptions))
...

seems to fix the issue.

Thanks!

1 Like