Cannot load data. There is not enough bytes to read from stream

Hi,

We are unable to open psd file. Download minimal repro program here. (9.1 MB)

Steps:

  1. Navigate to dir which contains TestAspose6.csproj

  2. > dotnet run

Unhandled exception. Aspose.PSD.CoreExceptions.ImageLoadException: Image loading failed.
—> Aspose.PSD.CoreExceptions.ImageFormats.PsdImageException: Cannot load data. There is not enough bytes to read from stream.
at .(StreamContainer , Int64 )
at .(StreamContainer )
at .Load(StreamContainer )
at Aspose.PSD.FileFormats.Psd.Layers.LayerResources.OSTypeStructuresRegistry.LoadResourceByFirstSupportedDescriptor(Stream stream)
at .Load(StreamContainer )
at Aspose.PSD.FileFormats.Psd.Layers.LayerResources.OSTypeStructuresRegistry.LoadResourceByFirstSupportedDescriptor(Stream stream)
at .Load(StreamContainer )
at Aspose.PSD.FileFormats.Psd.Layers.LayerResources.OSTypeStructuresRegistry.LoadResourceByFirstSupportedDescriptor(Stream stream)
at .Load(StreamContainer )
at Aspose.PSD.FileFormats.Psd.Layers.LayerResources.OSTypeStructuresRegistry.LoadResourceByFirstSupportedDescriptor(Stream stream)
at .(StreamContainer , String& , ClassID& )
at .Load(StreamContainer , Int32 )
at Aspose.PSD.FileFormats.Psd.Layers.LayerResourcesRegistry.LoadResourceByFirstSupportedDescriptor(Stream stream, Int32 psdVersion)
at .(StreamContainer , , Int64 )
at .(StreamContainer , , Int64 , LayerSectionType&, BlendMode& )
at .(StreamContainer , Int32 , , IColorPalette, , )
at .(StreamContainer , , IColorPalette , , )
at .(StreamContainer , , IColorPalette , Boolean, )
at .Load(StreamContainer , LoadOptions )
at Aspose.PSD.Image.(StreamContainer , LoadOptions )
— End of inner exception stack trace —
at Aspose.PSD.Image.(StreamContainer , LoadOptions )
at Aspose.PSD.Image.Load(String filePath)
at Program.$(String[] args) in C:\Users\mirol\source\repos\TestAspose6\TestAspose6\Program.cs:line 3

> dotnet --version
6.0.100

> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa

.NET SDKs installed:
5.0.403 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

We need this fixed, or workaround ASAP.
Thanks in advance.

Hello,

I can confirm this bug. We created task with high priority PSDNET-1036: PSD File with Smart Filter can not be opened with Aspose.PSD 21.11. You can track it by its id PSDNET-1036.

The quick workaround is to remove smart filter layer in Photoshop.image.png (76.0 KB)

Thank you.

The issues you have found earlier (filed as PSDNET-1036) have been fixed in this update. This message was posted using Bugs notification tool by Yaroslav.Lisovskyi