Jump to content

Photoshop PSD file plugin (newest version: 2.5.0)


taoyue
 Share

Recommended Posts

2 hours ago, otuncelli said:

@taoyue This plugin is affected by a behavior change in .NET 6.0: 

https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams

 

Couldn't open these files:

https://github.com/psd-tools/psd-tools/raw/main/tests/psd_files/32bit.psb

https://github.com/psd-tools/psd-tools/raw/main/tests/psd_files/32bit.psb

 

Both give this error.

  Reveal hidden contents
Exception:

System.AggregateException: One or more errors occurred. (ZIP stream was not fully decompressed.) (ZIP stream was not fully decompressed.) (ZIP stream was not fully decompressed.)
 ---> System.Exception: ZIP stream was not fully decompressed.
   at PhotoshopFile.Compression.ZipImage.Read(Byte[] buffer)
   at PhotoshopFile.Compression.ZipPredict32Image.Read(Byte[] buffer)
   at PhotoshopFile.Channel.DecodeImageData()
   at PhotoshopFile.PsdFile.<>c.<DecompressImages>b__64_1(Channel channel)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
   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)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
   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 PhotoshopFile.PsdFile..ctor(Stream stream, LoadContext loadContext)
   at PaintDotNet.Data.PhotoshopFileType.PsdLoad.Load(Stream input)
   at PaintDotNet.Data.PhotoshopFileType.PhotoshopFileType.OnLoad(Stream input)
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_4_3_x\Data\FileType.cs:line 498
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src_4_3_x\Base\Functional\Func.cs:line 158
 ---> (Inner Exception #1) System.Exception: ZIP stream was not fully decompressed.
   at PhotoshopFile.Compression.ZipImage.Read(Byte[] buffer)
   at PhotoshopFile.Compression.ZipPredict32Image.Read(Byte[] buffer)
   at PhotoshopFile.Channel.DecodeImageData()
   at PhotoshopFile.PsdFile.<>c.<DecompressImages>b__64_1(Channel channel)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 ---> (Inner Exception #2) System.Exception: ZIP stream was not fully decompressed.
   at PhotoshopFile.Compression.ZipImage.Read(Byte[] buffer)
   at PhotoshopFile.Compression.ZipPredict32Image.Read(Byte[] buffer)
   at PhotoshopFile.Channel.DecodeImageData()
   at PhotoshopFile.PsdFile.<>c.<DecompressImages>b__64_1(Channel channel)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---

 

 

I've created a PR on GitHub.

 

Thanks for investigating.  Please see my comments on Github.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...