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
System.NullReferenceException when attempt to Mutate.Draw on a new created Image<L8> #1224
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
Repo here: https://github.com/sn4k3/PrusaSL1Viewer
How to reproduce: Execute Main app -> Menu -> Open -> sl1 file from zip. Go to Menu -> Mutators -> Resize -> Pick any value diferent from 100 -> Click ok -> Error happen here
Note the error doesn't always trigger but most of the times will
System.NullReferenceException
HResult=0x80004003
Message=A referência de objecto não foi definida como uma instância de um objecto.
Source=mscorlib
StackTrace:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(Configuration configuration)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(IImageProcessingContext context)
at SixLabors.ImageSharp.Processing.DrawImageExtensions.DrawImage(IImageProcessingContext source, Image image, Point location, Single opacity)
at UVtools.Parser.FileFormat.<>c__DisplayClass124_1.b__2(IImageProcessingContext o) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Parser\FileFormat.cs:line 687
Activity
antonfirsov commentedon Jun 10, 2020
@sn4k3 how is the compilation error
CS0103related to the rest of the issue?Any chance you can create a self-contained console app repro? A lot may depend on image sizes, position of
x,yand other contextual factors.sn4k3 commentedon Jun 10, 2020
Repo here: https://github.com/sn4k3/PrusaSL1Viewer
How to reproduce: Execute Main app -> Menu -> Open -> sl1 file from zip. Go to Menu -> Mutators -> Resize -> Pick any value diferent from 100 -> Click ok -> Error happen here
Note the error doesn't always trigger but most of the times will
Void Resize(): https://github.com/sn4k3/PrusaSL1Viewer/blob/master/PrusaSL1Reader/FileFormat.cs#L636
Called at: https://github.com/sn4k3/PrusaSL1Viewer/blob/master/PrusaSL1Viewer/FrmMain.cs#L1893
input_file.zip
JimBobSquarePants commentedon Jun 16, 2020
I think this might be related to #1230 @sn4k3 if you can provide a stack trace that would be really useful.
sn4k3 commentedon Jun 16, 2020
JimBobSquarePants commentedon Jun 16, 2020
@sn4k3 Perfect. Yep, definitely the same issue. I've got #1234 waiting for review to fix this.