Updating Text Layer Removes All Layer Effects

Hello

When I update the text on a TextLayer using update_text(), all the FX (layer effects) applied to the layer are removed. After exporting the file to PNG, the updated text appears plain, without any of the original effects.

image.png (1,6 Ko)

Code :

from aspose.psd import Image
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import TextLayer
from aspose.pycore import cast
from aspose.psd.imageoptions import PngOptions
from aspose.psd.fileformats.png import PngColorType

# Load a PSD file
with Image.load("example.psd") as image:
    psd = cast(PsdImage, image)
    
    # Find the first TextLayer and update its text
    for layer in psd.layers:
        if isinstance(layer, TextLayer):
            print(f"Original Text: {layer.text}")
            
            # Update the text
            layer.update_text("New Text")
            print(f"Updated Text: {layer.text}")
            
            # Export to PNG
            png_options = PngOptions()
            png_options.color_type = PngColorType.TRUECOLOR_WITH_ALPHA
            psd.save("output.png", png_options)
            break

After running this, the exported output.png shows the updated text without any of the FX that were originally applied. Is this expected behavior, or am I missing a step to preserve the layer effects?

Thanks!

@TristanAdatte please try to update you code with the following LoadOptions:

    psdLoadOptions = PsdLoadOptions()
    psdLoadOptions.allow_warp_repaint = True
    psdLoadOptions.load_effects_resource = True

    with Image.load(sourceFile, psdLoadOptions) as image:
        psd = cast(PsdImage, image)

If it will not help, please provide PSD input file and the information about your OS and its environment.

Hello Dmitriy,

Thank you for your suggestion.
Unfortunately, updating the code with the provided LoadOptions did not resolve the issue.

Here is the PSD input file
PSD-INPUT.zip (17,2 Ko)

Windows 11 - Python 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)] on win32

Hi @Dmitriy.Sorokin any update ?

@TristanAdatte
I’m checking this on the latest Python release, I’ll write you back after investigation

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-2259,PSDPYTHON-114

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.