You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
context.BackgroundColor throws Object reference not set to an instance of an object. #1230
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Description
Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(Configuration configuration)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(IImageProcessingContext context)
at SixLabors.ImageSharp.Processing.BackgroundColorExtensions.BackgroundColor(IImageProcessingContext source, Color color)
at Dropmaker.Program.<RunOnce>b__12_0(IImageProcessingContext ctx) in C:\Users\misir\source\repos\Dropmarker\src\Program.cs:line 280
at SixLabors.ImageSharp.Processing.ProcessingExtensions.ProcessingVisitor.Visit[TPixel](Image`1 image)
at SixLabors.ImageSharp.Image`1.Accept(IImageVisitor visitor)
at SixLabors.ImageSharp.Advanced.AdvancedImageExtensions.AcceptVisitor(Image source, IImageVisitor visitor)
at SixLabors.ImageSharp.Processing.ProcessingExtensions.Mutate(Image source, Configuration configuration, Action`1 operation)
at SixLabors.ImageSharp.Processing.ProcessingExtensions.Mutate(Image source, Action`1 operation)
at Dropmaker.Program.RunOnce(State state) in C:\Users\misir\source\repos\Dropmarker\src\Program.cs:line 278
Steps to Reproduce
It happens sometimes when I compile & run this code.
changed the title [-]Object reference not set to an instance of an object.[/-][+]context.BackgroundColor throws Object reference not set to an instance of an object.[/+]on Jun 15, 2020
What do you mean by this, Is the issue intermittent? What environmental factors trigger a difference in result.
I really don't know what triggers the issue. Might be because of multithreaded process or something else. In case you're interested here's source code of the project: Program.cs:288. There might be some sort of low level issue which caused this code to throw an exception.
at System.Collections.Generic.Dictionary`2.TryInsert(TKeykey,TValuevalue,InsertionBehaviorbehavior)
Are you running this in multiple threads?
Yes. I did run this code in multiple threads to reduce time since I need to process thousands of images.
Activity
[-]Object reference not set to an instance of an object.[/-][+]context.BackgroundColor throws Object reference not set to an instance of an object.[/+]JimBobSquarePants commentedon Jun 16, 2020
What do you mean by this, Is the issue intermittent? What environmental factors trigger a difference in result.
Are you running this in multiple threads?
Use ConcurrentDictionary. Fix #1230
themisir commentedon Jun 16, 2020
I really don't know what triggers the issue. Might be because of multithreaded process or something else. In case you're interested here's source code of the project: Program.cs:288. There might be some sort of low level issue which caused this code to throw an exception.
Yes. I did run this code in multiple threads to reduce time since I need to process thousands of images.
JimBobSquarePants commentedon Jun 16, 2020
Thanks @themisir that's correlates with my findings. If got a fix in motion. #1234