Error when opening specific .ai files

Having an issue with certain .ai files being opened with Aspose.PSD (.Net Framework). The error returned is:

Aspose.PSD.Image.Load(FilePath)' threw an exception of type Aspose.PSD.CoreExceptions.ImageLoadException'
    Data: {System.Collections.ListDictionaryInternal}
    HResult: -2146233088
    HelpLink: null
    InnerException: {"Object reference not set to an instance of an object."}
    Message: "Image loading failed."
    Source: "Aspose.PSD"

Code to open the file is:

using (FileStream fileStreamPSD = File.Open(FilePath, FileMode.Open, FileAccess.Read))
{
	Aspose.PSD.Image aspPSDImage = Aspose.PSD.Image.Load(fileStreamPSD);

	Aspose.PSD.ImageOptions.PngOptions aspPSDPngOptions = new Aspose.PSD.ImageOptions.PngOptions();

	aspPSDImage.Save(FilePathDestination, aspPSDPngOptions);
	aspPSDImage.Dispose();
	aspPSDImage = null;
}

Sample file is attached here:
inMailX by Digitus Logo.zip (344.7 KB)

There error is on “Load”

Please let me know how to overcome this issue

@GaryO
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-2893

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.

@GaryO
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-2894

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.

@GaryO I’ve made quick investigation of the issue and the provided file. I can’t propose any fix, you can try to resave this file in the new application. The file has issue in cross-reference dictionary.

We will make the fix of Null-reference in Aspose.PSD 26.10, but the rendering of this file also has the issues, so, I’ve opened second task. Here is the current export of Aspose.PSD:
inMailX by Digitus Logo.png (11.6 KB)

Hi Dmitriy,

Thanks for having a look. Can you explain what is null? Is it specifically because the version of Illustrator is old?

@GaryO the issue is in the way that ColorSpace is stored, not as reference, but as text string. The task has high priority for the Team, so the fix will be in 26.10

1 Like

In PDF-compatible AI files, objects are linked via cross-reference tables. When color attributes are embedded directly as literals instead of indexed references, unhandled null checks crash the loader.

1 Like