We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.PSD for .NET - Getting ImageLoadException: Image loading failed on PSD load

I am trying to load in a PSD file, and I keep getting “Image loading failed”


Aspose.PSD.CoreExceptions.ImageLoadException
HResult=0x80131500
Message=Image loading failed.
Source=Aspose.PSD
StackTrace:
at Aspose.PSD.Image.(StreamContainer , LoadOptions )
at Aspose.PSD.Image.Load(String filePath, LoadOptions loadOptions)
at AsposeTest.Program.Main(String[] args) in C:\Users\myth_\source\repos\AsposeTest\AsposeTest\Program.cs:line 17

Inner Exception 1:
TypeInitializationException: The type initializer for ' ’ threw an exception.

Inner Exception 2:
TypeInitializationException: The type initializer for ' ’ threw an exception.

Inner Exception 3:
FileLoadException: Could not load file or assembly ‘System.Text.Encoding.CodePages, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040)


The line trying to load it:
var options = new PsdLoadOptions() { LoadEffectsResource = true };
using (var img = (PsdImage)Aspose.PSD.Image.Load(@“C:\Unmatched\VSGraphicTemplate.psd”, options))

I am on the nuget version 22.9.0. I’ve tried past versions as well and it appears to be an issue a ways back. I am happy to provide my PSD file and source in a message if necessary!

@645development could you please provide the file you trying to open.

AsposeSupport.zip (3.4 MB)

@DmitriySorokin it is attached… I originally planned on messaging it directly since it contained some IP in it, but I removed all that in the PSD and made a barebones C# solution, and confirmed it was still having the issue.

@645development I checked file. It can be opened and converted fine, but you need to add additional dependencies to your project: System.Drawing.Common and System.Text.Encoding.CodePages. You can use latest version or as demonstrated in this document: https://docs.aspose.com/psd/net/installation/#working-with-net-core-dlls-installed-via-msi-package.

We are working on removing the necessity to add these dependencies.