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!