Unable to cast object of type 'System.Int32' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]'

Hi,
When I’m trying to save the following folder I receive and Unable to cast object of type ‘System.Int32’ to type ‘System.Collections.Generic.Dictionary`2[System.String,System.Object]’.

Here is the folder
Test_File.7z (4.1 MB)

Here is the stack trace
at  .(Object , String )
at  .(Object , String )
at  .(Object , String )
at  .(Object , String )
at  .( [] , Object )
at  .(Dictionary`2 , Int32 , String ,  [] ,  [] )
at  .(Txt2Resource , Int32 , String ,  [] ,  [] , TextOrientation )
at  .()
at  .(StreamContainer , Int32 , IColorPalette ,  , Int32 )
at  .​ (Image , Stream , ImageOptionsBase , Rectangle )
at ​ .Export(Image , Stream , ImageOptionsBase , Rectangle )
at Aspose.PSD.Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
at Aspose.PSD.Image.Save(String filePath, ImageOptionsBase options)

I’m in a .net 8 project with x64 windows OS.

I’ve created the following mini test to reproduce the issue:
var outputPath = “target.psd”;
var image = Image.Load(“Test_File.psd”);
if (image is PsdImage psdImage)
{
var PsdImage = psdImage;

var imageOptions = new PsdOptions(PsdImage);

try
{
    PsdImage.Save(outputPath, imageOptions);
}
catch {
   
}

}
Additionally if I delete the only two embedded smart object layers the save works ok.
Can you help me with this?

Thanks!

@afaluta
Thank you for high-quality description to reproduce issue.

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

Issue ID(s): PSDNET-2469

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.