SixLabors.Core 1.0.0-ci0005
SixLabors.ImageSharp.Drawing 1.0.0-dev000954
SixLabors.ImageSharp 1.0.0-dev000954
SixLabors.Shapes 1.0.0-ci0005
SixLabors.Shapes.Text 1.0.0-ci0005
SixLabors.Fonts 1.0.0-beta0003
Windows 10 RS4 17127.1
App framework: .NET Framework 4.7.2
App architecture: x64
using (Image<Rgba32> image = new Image<Rgba32>(800, 800))
{
image.Mutate(x => x.DrawPolygon(
Rgba32.HotPink,
10,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)
}));
image.Save("test.bmp");
}
Results in a 800x800 black image. Switching to x86 results in a 800x800 image with pink triangle.
Handling of Vector2 seems to be broken in .NET Framework in x64/Release, this repro fails:
https://gist.github.com/riverar/4c4d7bd674aa0dd5602db5936c534e7d
Now if you excuse me, I have some yelling to do.
Microsoft has acknowledged this bug/fixed it https://developercommunity.visualstudio.com/content/problem/223410/vector2-incorrectly-populated-from-stack-floats-in.html?childToView=229518#comment-229518
Awaiting release information.
@riverar is this fixed with ImageSharp beta4 + .NET Core RC1?
@antonfirsov Does not repro with beta4 + (.NET Framework 4.7.2 or .NET Core 2.1.200).
@riverar thanks for checking!
@riverar what is the CPU you experienced this with?
@antonfirsov x64 architecture, the physical CPU doesn't matter. (Was a confirmed general float/framework bug.)
This is now fixed in .NET Framework 4.8. https://developercommunity.visualstudio.com/content/problem/223410/vector2-incorrectly-populated-from-stack-floats-in.html
Most helpful comment
Microsoft has acknowledged this bug/fixed it https://developercommunity.visualstudio.com/content/problem/223410/vector2-incorrectly-populated-from-stack-floats-in.html?childToView=229518#comment-229518
Awaiting release information.