Hey I am processing a long file using azure batcha and aspose.psd.
Error Message: Image loading failed.
Inner Exception: Expected positive number of bytes. (Parameter ‘requestedCount’)
Service: Aspose.PSD
Operation: Image.Load(string filePath)
Job ID: J1037GJZURC
Timestamp: 02/11/2026 03:47:06 UTC
Stack Trace:
at Aspose.PSD.Image.Load(String filePath, LoadOptions loadOptions)
at QStrauss.AssetProcessor.Engine.Engine.JobOperator.ProcessOperationAsync(JobExecutionContext context)
what i am doing is download the psb file on the local disk before process it, does anyone have an idea?
@Agustin_Cano
Thanks for the report. I have not confirmed this yet and can only confirm it after reproducing on our side. Based on your description, this might be a bug in Aspose.Psd when converting psb to unknown. To confirm and log it internally, I need a few details.
- What is the size (in MB/GB) of the PSB file you’re trying to load?
- Which .NET runtime and Aspose.PSD version are you using, and is the application built for x64?
- Are you using any custom
LoadOptions (e.g., MaxImageSize, ReadOnly) when calling Image.Load?
- Can you share the Azure Batch VM size and the amount of memory allocated to each task?
A support engineer will review these details and get back to you.
Once I have the missing details, I’ll try to reproduce this. If I can confirm it, I’ll log it internally and follow up here.
A support engineer will follow up in this thread if needed.
[quote=“Professionalize.Discourse, post:2, topic:325482”]
- What is the size (in MB/GB) of the PSB file you’re trying to load? 13GB
- Which .NET runtime and Aspose.PSD version are you using, and is the application built for x64? .net yes, for linux. .net 8 and psd 25
- Are you using any custom
LoadOptions (e.g., MaxImageSize, ReadOnly) when calling Image.Load?
I tried without any custom LoadOptions but also with a custom specifying ReadOnly = true
- Can you share the Azure Batch VM size and the amount of memory allocated to each task?
Standard_E8ads_v5, 64GB RAM.
@Agustin_Cano
Thanks for the report. I have not confirmed this yet and can only confirm it after reproducing on our side. Based on your description, this might be a bug in Aspose.Psd when converting psb to unknown. To confirm and log it internally, I need a few details.
- Is the application compiled specifically for x64 (not AnyCPU)?
- Are you passing any other
LoadOptions (e.g., MaxImageSize) or loading the file via a Stream instead of a file path?
- Could you provide a short code snippet that reproduces the
Image.Load call and the exception?
A support engineer will review these details and follow up in this thread.
Once I have the missing details, I’ll try to reproduce this. If I can confirm it, I’ll log it internally and follow up here.
A support engineer will follow up in this thread if needed.
-
- Is the application compiled specifically for x64 (not AnyCPU)?: dotnet publish -c Release -r linux-x64 --self-contained true -o ./publish
- Are you passing any other
LoadOptions (e.g., MaxImageSize) or loading the file via a Stream instead of a file path?:
var opts = new PsdLoadOptions()
{
ReadOnlyMode = false,
DataRecoveryMode = DataRecoveryMode.ConsistentRecover,
UseDiskForLoadEffectsResource = true,
LoadEffectsResource = true
};
using (PsdImage psdImage = (PsdImage)Image.Load(context.Resources.TemplatePath, opts))
{
-
- Could you provide a short code snippet that reproduces the
Image.Load call and the exception?: See attached error
sodapdf-converted.pdf (390.2 KB)
@Agustin_Cano could you please tell the what version of Aspose.PSD do you use? Yesterday we released 26.2 that contains fixes for the large file processing. Aspose.PSD has the versions from .NET 2 to .NET10, and these versions have differences. Could you please specify what version of .NET is used by you.
If the fixes in 26.2 don’t fix your issue, could you please provide input file and code to reproduces issue. If it suitable for you, please upload large file in the archieve to some cloud hosting and send me the link to this through the DM, because in other case, you file will be accessible for other forum visitors.
Hey @Dmitriy.Sorokin we are using .net 8, we are looking to use .net 10 soon.
Related to the upgrade, yes, we are going to try and validate.
@Agustin_Cano thank you, both .net8 and .net10 have the all needed modern fixes to support large files. So if the issue is still reproducable, we will be able to fix it.
I’ll be waiting for your message that the bug is gone or a test input file so we can reproduce error and fix it.
I have been testing this, we are using .net 8 and the latest aspose version. So far, we are seeing:
Analyzing (opening the file to undestand laters ) a psd file of 870mb… use up to13.5gb, is that normal?
@Agustin_Cano processing of large PSD/PSB files needs big amount of RAM, and it depends on the complexity of file. Please compare Aspose.PSD RAM consumption with the Adobe Photoshop RAM consumption on similar file, the difference between Aspose.PSD and Photoshop will be comparable like ~10-15% percent in one direction or another.
Please confirm, that issue that was described before is fixed.
Also, if the RAM consumption for your file seems abnormal, please upload compressed file to some cloud storage, from where we can download it and check. We constantly work on optimization, and additional fixes in the development.
No paid license is required to open this file (hence the lack of an attached license). The latest available version, 26.2.x, is used. Files are downloaded to temporary or local folders on the disk and attempts are made to read them from there.
See the attached code.
SnippetAsposePSD.zip (6.8 MB)
@Agustin_Cano could you please provide the input file. I hadn’t find url to this in the project.