Hello, we’ve detected a problem where whenever we try to save any PSD greater than 200MB in size AND of a certain dimension or larger (15600px x 10800px @ 300dpi or larger) , it throws the following exception:
Message=“The starting position is out of stream bounds. (Parameter ‘position’)”
We are using version 24.1.0 of Aspose.PSD (.net version).
Even a simple loading and saving of a PSD file that’s 200MB or larger AND 15600px x 10800px @ 300dpi or larger will cause the problem with the following code which all it does is load the file and save it (no manipulation of layers)
private MemoryStream SimpleExample()
{
PsdLoadOptions loadOptions = new PsdLoadOptions()
{
LoadEffectsResource = true,
UseDiskForLoadEffectsResource = true
};
using (var im = (PsdImage) Aspose.PSD.Image.Load("c:\\temp\\bigfile.psd", loadOptions))
{
try
{
MemoryStream saveAsStream = new MemoryStream();
im.Save(saveAsStream); //Exception happens here
return saveAsStream;
}
catch (Exception e)
{
return null;
}
}
}
This problem occurs on every file with that size AND dimension or greater however what is interesting is that if you have a file that’s 100MB AND 15600px x 10800px, it will save fine without throwing an exception.
To eliminate the possibility that there’s something wrong with our PSD files, we created a brand new simple PSD file from scratch (referenced as bigfile.psd) in the code that’s 15600px x 10800px @ 300dpi which has only 1 layer that is filled with the bucket tool with the color #414141. The result of this is a file that is greater than 200MBs and 15600px x 10800px @ 300dpi and it will throw the aforementioned exception. If you delete half of the layer (that you filled with the Color #414141), the file size will drop to a little over 100MBs instead of 200MBs, and the save operation will work fine without throwing an exception so again, it’s a problem that’s a combination of the file size AND the dimension being greater than a certain threshold together (we have files that are smaller in dimensions that are over 200MBs in size that all work fine for instance).
Here’s a link to download bigfile.psd: bigfile.psd
We would greatly appreciate your help as this is a showstopper bug for us and will be happy to provide any additional information to help you reproduce the problem. Thanks!