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

Free Support Forum - aspose.com

Aspose.Psd for .NET - possible bug handling a specific file

Hi,

I’m running into some troubles manipulating/saving a specific PSD file using Aspose.Psd for .NET.

The file works correctly in Photoshop, but it cannot be handled by Aspose.Psd.
After some tests I was able to identify a single layer that, if removed, allows Aspose.Psd to manipulate the file.

Here’s a code sample that triggers the error (which is very basic):

public static void func(string filePath)
{
    using (Aspose.PSD.FileFormats.Psd.PsdImage image = (Aspose.PSD.FileFormats.Psd.PsdImage)Aspose.PSD.Image.Load(filePath))
    {
        image.Save();
    }
}

This is the error message:

Index was outside the bounds of the array.

And the StackTrace:

   at    . (Int32[] , Rectangle , Byte[] , Rectangle , Byte , )
   at    . (Rectangle , LayerMaskData , Int32[] )
   at    . (Rectangle , Layer )
   at   . . (Int32[] , Rectangle , Point , Point , Layer )
   at   . . (Int32[] , Point , Point )
   at   . .Process(Rectangle , Int32[] , Point , Point )
   at    . (Rectangle )
   at    .Process(Rectangle , Int32[] , Point , Point )
   at   .Process(Rectangle , Int32[] , Point , Point )
   at    .LoadPartialArgb32Pixels(Rectangle , IPartialArgb32PixelLoader )
   at    .      (Rectangle )
   at    . (    , IList`1 ,    )
   at    . (Rectangle ,    , , Int32 , Int32 ,    )
   at    . (Rectangle ,    ,    )
   at   . (Rectangle , RasterImage , Point , Point )
   at   .      (Rectangle , RasterImage , Point , Point )
   at   . . (Int32 ,    , RasterImage , Rectangle , Point , Point )
   at   . .Process(Rectangle , Int32[] , Point , Point )
   at   . .      (Rectangle )
   at    . (    , IList`1 ,    )
   at    . (Rectangle ,    , , Int32 , Int32 ,    )
   at   . .LoadPartialArgb32Pixels(Rectangle , IPartialArgb32PixelLoader )
   at    .      (Rectangle )
   at    . (    , IList`1 ,    )
   at    . (Rectangle ,    , , Int32 , Int32 ,    )
   at    . (Rectangle ,    ,    )
   at    .       (Rectangle , IPartialArgb32PixelLoader )
   at Aspose.PSD.RasterImage. (Rectangle , IPartialArgb32PixelLoader )
   at Aspose.PSD.RasterImage.LoadPartialArgb32Pixels(Rectangle rectangle, IPartialArgb32PixelLoader partialPixelLoader)
   at Aspose.PSD.FileFormats.Psd.PsdImage.SaveData(Stream stream)
   at Aspose.PSD.DataStreamSupporter.Save(Stream stream)
   at Aspose.PSD.DataStreamSupporter. (Boolean )
   at Aspose.PSD.DataStreamSupporter. (Boolean )
   at Aspose.PSD.DataStreamSupporter.Save()
   at Aspose.PSD.Image.Save()

Is there any support representative to whom I can send the PSD file?

Thanks in advance!

Hello,

Could you please write the version of Aspose.PSD you used in your example?
We need the source file to investigate your issue. You can upload the file to this thread, even it is public no one except Aspose Staff Members and you will not be able to download the attached file. Also, you can upload a file to some cloud storage and then share it with me using direct messages.

Thank you.

Hi Dmitriy,

Thanks for your quick reply!

I’m using version 21.11.0 (latest on NuGet).

I’ll share a folder via Direct Message, as the file cannot be shared here (over 50MB).

Thank you

Thank you for your reply.

I created the issue: PSDNET-1033. Index out of range on the saving in the specific file

You can track its status by the task id: PSDNET-1033

We planned to fix this issue in the 21.12/22.01.

Thank you.