Prerequisites
ImageSharp.Drawing version
3.0.0
Other ImageSharp packages and versions
ImageSharp 4.0.0
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
.NET 10 & .NET 11 preview 4
Description
Since updates to the new major versions of ImageSharp and ImageSharp. Drawing I have been experiencing some very rare and impossible to consistently reproduce issues when drawing lines. One of these instances I ran into is a stackoverflow where the DefaultRasterizer.AddContainedLineF24Dot8 method was invoked over 12.000 times recursively. Since the occurrence is so rare and my attempts to reproduce it have failed, I find it a bit hard to describe what could be potentially causing this. It must be noted that this snippet of code has worked fine for over a year before updating to the new major versions. The change made at the time was to include the extra Paint operation, rather than drawing the line directly in the Mutate operation. My apologies for not being able to provide more information, but this is all the information I was able to gather.
Steps to Reproduce
var image = new Image<Rgba32>(width, height, new Rgba32(0, 0, 0, 0));
// ...
image.Mutate(ctx =>
{
ctx.Paint(canvas =>
{
canvas.Clear(Brushes.Solid(SixLabors.ImageSharp.Color.Transparent));
var path = GetPath(); // 5 points where 1st = 5th point. Is different each time.
var pen = new SolidPen(SixLabors.ImageSharp.Color.Black, 4f);
canvas.DrawLine(pen, path);
});
});
Images
No response
Prerequisites
DEBUGandRELEASEmodeImageSharp.Drawing version
3.0.0
Other ImageSharp packages and versions
ImageSharp 4.0.0
Environment (Operating system, version and so on)
Windows 11
.NET Framework version
.NET 10 & .NET 11 preview 4
Description
Since updates to the new major versions of ImageSharp and ImageSharp. Drawing I have been experiencing some very rare and impossible to consistently reproduce issues when drawing lines. One of these instances I ran into is a stackoverflow where the
DefaultRasterizer.AddContainedLineF24Dot8method was invoked over 12.000 times recursively. Since the occurrence is so rare and my attempts to reproduce it have failed, I find it a bit hard to describe what could be potentially causing this. It must be noted that this snippet of code has worked fine for over a year before updating to the new major versions. The change made at the time was to include the extraPaintoperation, rather than drawing the line directly in theMutateoperation. My apologies for not being able to provide more information, but this is all the information I was able to gather.Steps to Reproduce
Images
No response