Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

GrimAce

A free sprite compositing tool · By Dreamnoid

Bug when opening PSD file

A topic by Archeia created Mar 25, 2016 Views: 824 Replies: 15
Viewing posts 1 to 12

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at Faces.Core.Surface..ctor(Int32 width, Int32 height)

at Faces.Core.PSDLayer.FromPSD(String filename)

at Faces.Core.Process.LoadLayers()

at Faces.Core.Process.GetAllLayers()

at Faces.MainWindowVM.<RefreshAllLayersAsync>b__1f()

at System.Threading.Tasks.Task`1.InnerInvoke()

at System.Threading.Tasks.Task.Execute()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<RefreshAllLayersAsync>d__20.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<ChangePSDCmdAsync>d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.AsyncRelayCommand.<FireAndForget>d__0.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass2.<ThrowAsync>b__3(Object state)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I tried reducing the psd file to lower size and this happened:


System.AggregateException: One or more errors occurred. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )

--- End of inner exception stack trace ---

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

at System.Threading.Tasks.Task.Wait()

at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)

at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)

at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)

at PhotoshopFile.PsdFile.DecompressImages()

at PhotoshopFile.PsdFile.Load(Stream stream, LoadContext loadContext)

at Faces.Core.PSDLayer.FromPSD(String filename)

at Faces.Core.Process.LoadLayers()

at Faces.Core.Process.GetAllLayers()

at Faces.MainWindowVM.<RefreshAllLayersAsync>b__1f()

at System.Threading.Tasks.Task`1.InnerInvoke()

at System.Threading.Tasks.Task.Execute()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<RefreshAllLayersAsync>d__20.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<ChangePSDCmdAsync>d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.AsyncRelayCommand.<FireAndForget>d__0.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass2.<ThrowAsync>b__3(Object state)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

---> (Inner Exception #0) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #1) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #2) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #3) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #4) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #5) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

---> (Inner Exception #6) System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

at PhotoshopFile.Channel.DecompressImageData()

at PhotoshopFile.Channel.DecodeImageData()

at PhotoshopFile.PsdFile.<DecompressImages>b__1(Channel channel)

at System.Threading.Tasks.Parallel.<>c__DisplayClass27`2.<PartitionerForEachWorker>b__29()

at System.Threading.Tasks.Task.InnerInvoke()

at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

at System.Threading.Tasks.Task.<>c__DisplayClass0.<ExecuteSelfReplicating>b__1(Object )<---

Developer

Hi,

Thank you for your report. I uploaded a new version with some memory optimizations. Can you please give it another shot and tell me if your file is working now ?

Thanks :)

I tried v2!


System.IndexOutOfRangeException: Index was outside the bounds of the array.

at Faces.Core.PSDLayer.FromPSD(String filename)

at Faces.Core.Process.LoadLayers()

at Faces.Core.Process.GetAllLayers()

at System.Threading.Tasks.Task`1.InnerInvoke()

at System.Threading.Tasks.Task.Execute()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<RefreshAllLayersAsync>d__20.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.MainWindowVM.<ChangePSDCmdAsync>d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Faces.AsyncRelayCommand.<FireAndForget>d__0.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass2.<ThrowAsync>b__3(Object state)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Developer(+1)

Hmm. That one is a lot more tricky. Without access to the PSD file, my guess is that it may be caused by a layer mask. I've uploaded a new revision that should be more robust dealing with those, so maybe it will be able to load your file now, but I can't guarantee the output will be 100% correct.

I have a task on the project's Trello board to fix that for good (https://trello.com/c/STRvn6Xu) but I will not be able to work on it before Tuesday, and even then, it might takes some time to get it right.

(1 edit)

Hm, I do use some unique layer masks that is only in Photoshop CC. Here's the new error I got:

System.InvalidOperationException: Stack empty.

at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)

at System.Collections.Generic.Stack`1.Pop()

at Grimace.Core.PSDLayer.FromPSD(String filename)

at Grimace.Core.Process.LoadLayers()

at Grimace.Core.Process.GetAllLayers()

at System.Threading.Tasks.Task`1.InnerInvoke()

at System.Threading.Tasks.Task.Execute()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Grimace.Editor.MainWindowVM.<RefreshAllLayersAsync>d__21.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Grimace.Editor.MainWindowVM.<ChangePSDCmdAsync>d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Grimace.Editor.AsyncRelayCommand.<FireAndForget>d__0.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass2.<ThrowAsync>b__3(Object state)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

(1 edit)

I think what the program doesn't like is

1.) Curves for Color Adjustment (because it's a generator psd file, it's easier to just create an adjustment color layer on top of all of them).

2.) Masks for fast clean up

Developer

Okay, I'm back, and with a new version.

I believe the last problem was due to me taking some shortcuts with the layer groups that work with files saved by CS* but not CC. It should be fixed.
I also improved the support for the layer masks.

That being said, the adjustment layers are currently not supported. I would like to support some of them (probably levels, curves, gradient map, brightness/contrast, hue/saturation & color balance) but they're very tricky and the documentation is... not great. So it will take time, at the very least.

Sorry 'bout that, re-implementing Photoshop's renderer is no easy task, and it will take some times before everything turns out perfectly ^^'

It's Ok! I figured as much that it'd be hard :D

I'll test them again once I'm on my PC!

(2 edits)

Good News! It works! Bad news, I have to clean up the masks + layers www
But great job~

Developer

At least we're making some progress :)

I uploaded a new version with some bug fixes revolving around masks, but if you're using features unique to CC it may not be what you're looking for.

Could you please describe what exactly does not work with your masks? And if possible, could you please send me a PSD file showcasing those problems, so I can investigate further?

Thanks!

Is there a way that I can send it to you privately? I don't feel comfortable sending PSD file of my drawing to public :D;

Developer

Sure, you can drop me an email at dri@dreamnoid.com. I will take a look at it next week :)

I sent the email <3

Developer(+1)

I opened your file using the latest version, and it looks exactly like Photoshop. But I use CS4, so I'm not sure everything's there. Is that how it's supposed to look?

I just published this version, if you want to try it for yourself :)

In Version 6 it didn't work but the latest one works flawlessly it seems! Thank you <3