-
-
Notifications
You must be signed in to change notification settings - Fork 888
Description
Description
What i'm trying to do: Resize white pixels but keep original image Width & Height
Error: newImage=error CS0103: The name 'newImage' does not exist in the current context
void Resize() is called under a Task
this[layerIndex].Image; // Creates a new Image that loads compressed bytes in
Parallel Loop is executed once, every image instance are new objects created inside the loop (Not shared with other iterations)
Only line "newImage.Mutate(o => o.DrawImage(image, location, 1f));" can trigger the error, Resize operation always pass.
Collection is from 500 to 1000 images but i also tried with just one, same behaviour
This error don't always happens, if i keep redoing same operation sometimes it finish ok without error, others dont.
If i turn Parallel for into a normal for loop problem seens to never happen but of course way slower than using parallel which is what make me use Parallel instead.
System Configuration
- ImageSharp version: 1.0.0-rc0002
- Environment (Operating system, version and so on): Windows 10 v1909
- .NET Framework version: .NET Standard 2.0 library, method called from .NET Framework 4.8 WinForm
