Skip to content

Commit d1cfa8d

Browse files
Add explicit test
1 parent 666ae9e commit d1cfa8d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,21 @@ public void RgbaVector_FromGrey8()
189189
// assert
190190
Assert.Equal(expected, rgba.ToScaledVector4());
191191
}
192+
193+
[Fact]
194+
public void Issue2048()
195+
{
196+
// https://github.com/SixLabors/ImageSharp/issues/2048
197+
RgbaVector green = Color.Green.ToPixel<RgbaVector>();
198+
using Image<RgbaVector> source = new(Configuration.Default, 1, 1, green);
199+
using Image<HalfVector4> clone = source.CloneAs<HalfVector4>();
200+
201+
Rgba32 srcColor = default;
202+
Rgba32 cloneColor = default;
203+
source[0, 0].ToRgba32(ref srcColor);
204+
clone[0, 0].ToRgba32(ref cloneColor);
205+
206+
Assert.Equal(srcColor, cloneColor);
207+
}
192208
}
193209
}

0 commit comments

Comments
 (0)