Error must contain 3 color components for RGB or 4 color components for CMYK

Loading the psd it throws the following error:

   Unhandled exception. Aspose.PSD.CoreExceptions.ImageLoadException: Image loading failed.
---> Aspose.PSD.CoreExceptions.ImageFormats.PsdImageException: Color section in the resource must contain 3 color components for RGB or 4 color components for CMYK
   at    . (DescriptorStructure  )
   at    . (ColorFillSettings  , OSTypeStructure  )
   at     . (Layer  )
   at Aspose.PSD.FileFormats.Psd.Layers.ShapeLayer.vyhrzjdq957zu2kbxkgl8enhe26hgrrd    ()
   at Aspose.PSD.FileFormats.Psd.PsdImage.      ,      ,     ,     ,     , Int32 , LoadOptions , Boolean   )
   at     .Load(StreamContainer  , LoadOptions  )
   at Aspose.PSD.Image. (StreamContainer  , LoadOptions  )
   --- End of inner exception stack trace ---
   at Kurryer.PsdEditor.Core.Commands.DicLsak.DicLsakCommand.Run(DicLsakOptions opt) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Core\Commands\DicLsak\DicLsakCommand.cs:line 49
   at Kurryer.PsdEditor.Core.Commands.DicLsak.DicLsakCommand.Execute(DicLsakOptions opt) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Core\Commands\DicLsak\DicLsakCommand.cs:line 19
   at Kurryer.PsdEditor.Core.PsdEditorImp.<Execute>b__4_0(DicLsakOptions o) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Core\PsdEditorImp.cs:line 29
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 notParsedFunc)
   at Kurryer.PsdEditor.Core.PsdEditorImp.Execute(String[] args) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Core\PsdEditorImp.cs:line 37
   at Kurryer.PsdEditor.Cmd.RunCommand.StartAsync(CancellationToken cancellationToken) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Cmd\RunCommand.cs:line 26
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Kurryer.PsdEditor.Cmd.Program.Main(String[] args) in C:\Ethofy\Kurryer\repos\Kurryer.PsdEditor\Kurryer.PsdEditor.Cmd\Program.cs:line 24
   at Kurryer.PsdEditor.Cmd.Program.<Main>(String[] args)

Code Used:
code-must contain 3 color components for RGB or 4 color components for CMYK.zip (890 Bytes)

Psd used:
input-psd-must contain 3 color components for RGB or 4 color components for CMYK.zip (409 Bytes)

Is there any workaround?

@cristianortegaethofy
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-1747

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

11.zip (1.4 MB)
I have attached a PSD that has a single gradient layer and was identified as the one generating the error.
To review what is happening with just that layer and if there is any workaround to move forward.

@cristianortegaethofy I checked this issue on the current status of Aspose.PSD. It’s already fixed. We plan release of Aspose.PSD 23.10 next week.

That’s good news, thank you!

1 Like