TextLayer.update_text(str) and PsdImage.save() raising Proxy Error (NullReferenceException)

Hi all,

Hope you can help me…

I am running a test calling the above functions on an Ubuntu 22.04 via the python via .NET wheel downloadable from aspose with a temporary license and receiving the error message “RuntimeError: Proxy error(NullReferenceException): Object reference not set to an instance of an object” every time these calls execute.

As my parameters match all the examples in the docs I am thinking I’m missing some sort of reference or DLL, backed up against similar errors with other aspose products appearing with that as the issue in these forums but am at a loss as to what or how to identify that so any help you can offer here would be really great?

@Ben_Weatherall could you please provide input file and code snippet to reproduce this.

Sure, my source is as shown below, commenting out line 43 generates the same exception from line 44 instead.

import io, os, shutil
from aspose.psd import License
from aspose.psd import Image
from aspose.psd.fileformats.png import PngColorType
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import TextLayer
from aspose.psd.imageloadoptions import PsdLoadOptions
from aspose.psd.imageoptions import PngOptions
from aspose.pycore import cast

# Apply license. Valid for 30 days from 23/04/2024
license = License()
license.set_license('/home/ben/projects/psd-tools-test/temp-license.lic')


# Specify File Paths
sourceFile = "bd-worlds-best-pink-tweaked.psd"
outputFile = "test-output.psd"

if os.path.exists(outputFile):
    os.remove(outputFile)

shutil.copyfile(sourceFile, outputFile)

# Specify Load Options
loadOptions = PsdLoadOptions()
loadOptions.load_effects_resource = True
loadOptions.allow_warp_repaint = True

# Open File using Aspose.PSD for Python
with Image.load(outputFile, loadOptions) as image:
    # Types of Aspose.PSD can be casted
    psdImage = cast(PsdImage, image)

    for i in range(0, psdImage.layers.length):

        try:
            layer = cast(TextLayer, psdImage.layers[i])
        except:
            continue

        if layer.text == '*':
            layer.update_text('SUCCESS')
            psdImage.save(outputFile)
            break

input PSD file used: bd-worlds-best-pink.psd.zip (462.9 KB)

@Ben_Weatherall
I can confirm this issue. Also, it can be reproduced in Aspose.PSD for .NET. I set High Priority to this bug.

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-2032,PSDPYTHON-48

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.

Thanks Dmitriy, so this isn’t something I’m missing or doing wrong then - darn it!

I’m afraid I can’t buy the paid support for this as was still evaluating the product viability for our use-case here at this point. Is there somewhere I can see updates on the internal ticket to monitor for a resolution or would it just appear in this thread?

@Ben_Weatherall After the fixing of issue, you will be notified through the forum functionality. Usually, the .NET fixes delivered first.

Could you please provide some additional information, have you on your PC any Asian Font Installed? Or any other language-specific fonts? Have you installed any non-default fonts?

Hi Dimiriy, that’s great. No non-standard fonts here that I’ve installed and just the standard Ubuntu load for UK English on there at the moment.

@Ben_Weatherall thank you for the additional information. I’ll text you back if there will be news according to this issue.