Skip to content

Commit b019161

Browse files
committed
imagesharp v4
1 parent 3381dd4 commit b019161

7 files changed

Lines changed: 12 additions & 10 deletions

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public Task VerifyImage()
101101
{
102102
var image = new Image<Rgba32>(11, 11)
103103
{
104-
[5, 5] = Rgba32.ParseHex("#0000FF")
104+
[5, 5] = Color.ParseHex("#0000FF").ToPixel<Rgba32>()
105105
};
106106
return Verify(image);
107107
}
@@ -138,7 +138,7 @@ public Task VerifyImageWithSsimThreshold()
138138
{
139139
var image = new Image<Rgba32>(11, 11)
140140
{
141-
[5, 5] = Rgba32.ParseHex("#0000FF")
141+
[5, 5] = Color.ParseHex("#0000FF").ToPixel<Rgba32>()
142142
};
143143
return Verify(image)
144144
.SsimThreshold(0.95);

src/Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649;NU1608;NU1109</NoWarn>
5-
<Version>5.0.1</Version>
5+
<Version>5.1.0</Version>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<LangVersion>preview</LangVersion>
88
<AssemblyVersion>1.0.0</AssemblyVersion>
@@ -13,5 +13,6 @@
1313
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1414
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1515
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
16+
<SixLaborsLicenseFile>$(MSBuildThisFileDirectory)sixlabors.lic</SixLaborsLicenseFile>
1617
</PropertyGroup>
17-
</Project>
18+
</Project>
-525 Bytes
Loading
462 KB
Loading

src/Tests/Samples.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Task VerifyImage()
2828
{
2929
var image = new Image<Rgba32>(11, 11)
3030
{
31-
[5, 5] = Rgba32.ParseHex("#0000FF")
31+
[5, 5] = Color.ParseHex("#0000FF").ToPixel<Rgba32>()
3232
};
3333
return Verify(image);
3434
}
@@ -42,7 +42,7 @@ public Task VerifyImageWithCustomEncoder()
4242
{
4343
var image = new Image<Rgba32>(11, 11)
4444
{
45-
[5, 5] = Rgba32.ParseHex("#0000FF")
45+
[5, 5] = Color.ParseHex("#0000FF").ToPixel<Rgba32>()
4646
};
4747
return Verify(image)
4848
.EncodeAsJpeg();
@@ -55,7 +55,7 @@ public Task StreamWithNonZeroPosition()
5555
{
5656
var image = new Image<Rgba32>(11, 11)
5757
{
58-
[5, 5] = Rgba32.ParseHex("#FF0000")
58+
[5, 5] = Color.ParseHex("#FF0000").ToPixel<Rgba32>()
5959
};
6060
var stream = new MemoryStream();
6161
image.SaveAsPng(stream);

src/Tests/SsimTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void CompletelyDifferentImages()
2424
{
2525
for (var x = 0; x < 100; x++)
2626
{
27-
white[x, y] = new Rgba32(255, 255, 255, 255);
27+
white[x, y] = new(255, 255, 255, 255);
2828
}
2929
}
3030

@@ -41,7 +41,7 @@ public void SlightlyDifferentImages()
4141
// change a few pixels slightly
4242
for (var x = 0; x < 10; x++)
4343
{
44-
image2[x, 0] = new Rgba32(10, 10, 10, 255);
44+
image2[x, 0] = new(10, 10, 10, 255);
4545
}
4646

4747
var ssim = SsimComparer.Calculate(Encode(image1), Encode(image2));
@@ -65,7 +65,7 @@ public Task VerifyImageWithSsimThreshold()
6565
{
6666
var image = new Image<Rgba32>(11, 11)
6767
{
68-
[5, 5] = Rgba32.ParseHex("#0000FF")
68+
[5, 5] = Color.ParseHex("#0000FF").ToPixel<Rgba32>()
6969
};
7070
return Verify(image)
7171
.SsimThreshold(0.95);

src/sixlabors.lic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Id=ctm_01k4a0m3dxnya9epg35rqqxs29;Kind=Community;ExpiryDateUtc=2026-12-03T09:33:00.1566670Z;Key=M+2oIq6h6sAag2H476SNAgeI8LUHBYIhPnTHNzADw2WBuJ9+KYC8ouKV6kgbg78CuxMC2FbgnNUcHvvIT/s8Qg==

0 commit comments

Comments
 (0)