Free Support Forum - aspose.com

'Array Dimensions exceeded supported range' on Save to jpg on very large file

I have a PSB files that are 57953 x 15039 pixels (and similiar sizes). I am trying to get a resized jpg image however I am getting error after Resize and then Save. Also receive error same error if I just run image.Flatten() without any resize or save. Seem like it can’t handle a something this size?

OverflowException: Array dimensions exceeded supported range.

Aspose.PSD.CoreExceptions.ImageSaveException
HResult=0x80131500
Message=Image saving failed.
Source=Aspose.PSD
StackTrace:
at Aspose.PSD.Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
at Aspose.PSD.Image.Save(String filePath, ImageOptionsBase options)
This exception was originally thrown at this call stack:
<>. (long, long)
.(long)
.()
.()
. ( .)
.Process(Aspose.PSD.Rectangle, byte[], Aspose.PSD.Point, Aspose.PSD.Point)
.Process(Aspose.PSD.Rectangle, int[], Aspose.PSD.Point, Aspose.PSD.Point)
.Process(Aspose.PSD.Rectangle, int[], Aspose.PSD.Point, Aspose.PSD.Point)
. (Aspose.PSD.Rectangle)
.( , System.Collections.Generic.IList<Aspose.PSD.Rectangle>, )

[Call Stack Truncated]
Inner Exception 1:
ImageSaveException: Image export failed.

Inner Exception 2:
OverflowException: Array dimensions exceeded supported range.

@dan123456,

I have observed the issue shared by you and request you to please try using latest Aspose.PSD for .NET 20.4 on your end. In case there is still an issue then please share the working sample coed along with source file with us.