[GH-ISSUE #37] [Bug] System.AggregateException #1402

Closed
opened 2026-03-01 18:45:14 +03:00 by kerem · 2 comments
Owner

Originally created by @Kristinita on GitHub (Nov 20, 2016).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/37

Summary

GIF with several title frames and fade effects not encode for me.

Expected behavior

Expected

Actual behavior

Actual

Error: произошла одна или несколько ошибок.

Translate:

Error: One or more errors

Click on this message to see full log:

► Title - 
    Encode
▬ Message - 
    Произошла одна или несколько ошибок.
○ Type - 
    System.AggregateException
♦ Date/Hour - 
    20.11.2016 7:03:06
▲ Source - 
    mscorlib
▼ TargetSite - 
    Void ThrowIfExceptional(Boolean)
♠ StackTrace - 
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   в System.Threading.Tasks.Task.Wait()
   в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
   в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource)
   в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource)

▬▬ Message - 
    Индекс находился вне границ массива.
○○ Type - 
    System.IndexOutOfRangeException
▲▲ Source - 
    ScreenToGif
▼▼ TargetSite - 
    System.Drawing.Color GetPixel(Int32, Int32)
♠♠ StackTrace - 
   в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y)
   в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x)
   в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   в System.Threading.Tasks.Task.InnerInvoke()
   в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

----------------------------------

► Title - 
    Encode
▬ Message - 
    Произошла одна или несколько ошибок.
○ Type - 
    System.AggregateException
♦ Date/Hour - 
    20.11.2016 7:03:40
▲ Source - 
    mscorlib
▼ TargetSite - 
    Void ThrowIfExceptional(Boolean)
♠ StackTrace - 
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   в System.Threading.Tasks.Task.Wait()
   в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
   в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource)
   в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource)

▬▬ Message - 
    Индекс находился вне границ массива.
○○ Type - 
    System.IndexOutOfRangeException
▲▲ Source - 
    ScreenToGif
▼▼ TargetSite - 
    System.Drawing.Color GetPixel(Int32, Int32)
♠♠ StackTrace - 
   в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y)
   в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x)
   в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   в System.Threading.Tasks.Task.InnerInvoke()
   в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

----------------------------------

► Title - 
    Encode
▬ Message - 
    Произошла одна или несколько ошибок.
○ Type - 
    System.AggregateException
♦ Date/Hour - 
    20.11.2016 7:04:31
▲ Source - 
    mscorlib
▼ TargetSite - 
    Void ThrowIfExceptional(Boolean)
♠ StackTrace - 
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   в System.Threading.Tasks.Task.Wait()
   в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
   в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource)
   в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource)

▬▬ Message - 
    Индекс находился вне границ массива.
○○ Type - 
    System.IndexOutOfRangeException
▲▲ Source - 
    ScreenToGif
▼▼ TargetSite - 
    System.Drawing.Color GetPixel(Int32, Int32)
♠♠ StackTrace - 
   в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y)
   в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x)
   в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   в System.Threading.Tasks.Task.InnerInvoke()
   в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

----------------------------------

► Title - 
    Encode
▬ Message - 
    Произошла одна или несколько ошибок.
○ Type - 
    System.AggregateException
♦ Date/Hour - 
    20.11.2016 7:28:27
▲ Source - 
    mscorlib
▼ TargetSite - 
    Void ThrowIfExceptional(Boolean)
♠ StackTrace - 
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   в System.Threading.Tasks.Task.Wait()
   в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
   в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource)
   в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource)

▬▬ Message - 
    Индекс находился вне границ массива.
○○ Type - 
    System.IndexOutOfRangeException
▲▲ Source - 
    ScreenToGif
▼▼ TargetSite - 
    System.Drawing.Color GetPixel(Int32, Int32)
♠♠ StackTrace - 
   в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y)
   в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x)
   в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   в System.Threading.Tasks.Task.InnerInvoke()
   в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

----------------------------------

Steps to reproduce

I create GIF 3 Title frames and 3 fade effects → Save As:

  • if I select Legacy Encoder I get error,
  • if I select ScreenToGIF Encoder I get error,
  • if I select System Encoder, 167(!) MB GIF encode for me. No program is open this file.

In E:\Chocolatey\lib\screentogif\content\Logs directory I saw log_20_11_2016.txt file.

Attached file

I save my project file

Environment

Operating system and version:
Windows 32-bit 10.0.14393
ScreenToGif:
2.3.161030
.NET Framework
4.6 Build 394802

Thanks.

Originally created by @Kristinita on GitHub (Nov 20, 2016). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/37 ### Summary GIF with several title frames and fade effects not encode for me. ### Expected behavior ![Expected](http://i.imgur.com/e0ZEiF2.gif) ### Actual behavior ![Actual](http://i.imgur.com/iPvXcJv.png) > Error: произошла одна или несколько ошибок. Translate: > Error: One or more errors <details> <summary> _Click on this message to see full log:_</summary> ``` ► Title - Encode ▬ Message - Произошла одна или несколько ошибок. ○ Type - System.AggregateException ♦ Date/Hour - 20.11.2016 7:03:06 ▲ Source - mscorlib ▼ TargetSite - Void ThrowIfExceptional(Boolean) ♠ StackTrace - в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) в System.Threading.Tasks.Task.Wait() в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource) в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource) ▬▬ Message - Индекс находился вне границ массива. ○○ Type - System.IndexOutOfRangeException ▲▲ Source - ScreenToGif ▼▼ TargetSite - System.Drawing.Color GetPixel(Int32, Int32) ♠♠ StackTrace - в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y) в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x) в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1() в System.Threading.Tasks.Task.InnerInvoke() в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) ---------------------------------- ► Title - Encode ▬ Message - Произошла одна или несколько ошибок. ○ Type - System.AggregateException ♦ Date/Hour - 20.11.2016 7:03:40 ▲ Source - mscorlib ▼ TargetSite - Void ThrowIfExceptional(Boolean) ♠ StackTrace - в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) в System.Threading.Tasks.Task.Wait() в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource) в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource) ▬▬ Message - Индекс находился вне границ массива. ○○ Type - System.IndexOutOfRangeException ▲▲ Source - ScreenToGif ▼▼ TargetSite - System.Drawing.Color GetPixel(Int32, Int32) ♠♠ StackTrace - в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y) в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x) в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1() в System.Threading.Tasks.Task.InnerInvoke() в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) ---------------------------------- ► Title - Encode ▬ Message - Произошла одна или несколько ошибок. ○ Type - System.AggregateException ♦ Date/Hour - 20.11.2016 7:04:31 ▲ Source - mscorlib ▼ TargetSite - Void ThrowIfExceptional(Boolean) ♠ StackTrace - в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) в System.Threading.Tasks.Task.Wait() в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource) в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource) ▬▬ Message - Индекс находился вне границ массива. ○○ Type - System.IndexOutOfRangeException ▲▲ Source - ScreenToGif ▼▼ TargetSite - System.Drawing.Color GetPixel(Int32, Int32) ♠♠ StackTrace - в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y) в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x) в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1() в System.Threading.Tasks.Task.InnerInvoke() в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) ---------------------------------- ► Title - Encode ▬ Message - Произошла одна или несколько ошибок. ○ Type - System.AggregateException ♦ Date/Hour - 20.11.2016 7:28:27 ▲ Source - mscorlib ▼ TargetSite - Void ThrowIfExceptional(Boolean) ♠ StackTrace - в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) в System.Threading.Tasks.Task.Wait() в System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) в System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) в ScreenToGif.ImageUtil.ImageMethods.PaintTransparentAndCut(List`1 listToEncode, Color transparent, Int32 id, CancellationTokenSource tokenSource) в ScreenToGif.Windows.Encoder.Encode(List`1 listFrames, Int32 id, Parameters param, CancellationTokenSource tokenSource) ▬▬ Message - Индекс находился вне границ массива. ○○ Type - System.IndexOutOfRangeException ▲▲ Source - ScreenToGif ▼▼ TargetSite - System.Drawing.Color GetPixel(Int32, Int32) ♠♠ StackTrace - в ScreenToGif.ImageUtil.PixelUtilOld.GetPixel(Int32 x, Int32 y) в ScreenToGif.ImageUtil.ImageMethods.<>c__DisplayClass0_0.<PaintTransparentAndCut>b__0(Int32 x) в System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1() в System.Threading.Tasks.Task.InnerInvoke() в System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) в System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) ---------------------------------- ``` </details> ### Steps to reproduce I create GIF 3 Title frames and 3 fade effects → ``Save As``: + if I select `Legacy` Encoder I get error, + if I select `ScreenToGIF` Encoder I get error, + if I select `System` Encoder, 167(!) MB GIF encode for me. No program is open this file. In `E:\Chocolatey\lib\screentogif\content\Logs` directory I saw `log_20_11_2016.txt` file. ### Attached file [I save my project file](http://jmp.sh/nDSYhL1) ### Environment **Operating system and version:** Windows 32-bit 10.0.14393 **ScreenToGif:** 2.3.161030 **.NET Framework** 4.6 Build 394802 Thanks.
kerem 2026-03-01 18:45:14 +03:00
Author
Owner

@NickeManarin commented on GitHub (Nov 21, 2016):

Looks like at least one of the frames has a different size. Could be related to a bug related to high DPI. Working on it.

<!-- gh-comment-id:261830864 --> @NickeManarin commented on GitHub (Nov 21, 2016): Looks like at least one of the frames has a different size. Could be related to a bug related to high DPI. Working on it.
Author
Owner

@NickeManarin commented on GitHub (May 2, 2017):

With previous fixes (v2.7) this bug got less common. But even if someone tries to manually resize the frames by opening the temp folder, the app will not throw an exception, it will treat the missing pixels as a transparent color.

<!-- gh-comment-id:298476252 --> @NickeManarin commented on GitHub (May 2, 2017): With previous fixes (v2.7) this bug got less common. But even if someone tries to manually resize the frames by opening the temp folder, the app will not throw an exception, it will treat the missing pixels as a transparent color.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1402
No description provided.