Skip to content

Commit 22e376c

Browse files
Merge branch 'main' into dependabot/github_actions/codecov/codecov-action-5
2 parents 3fc9164 + 0774da7 commit 22e376c

File tree

248 files changed

+5274
-2226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+5274
-2226
lines changed

.editorconfig

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:war
104104
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
105105
dotnet_style_parentheses_in_other_operators = always_for_clarity:suggestion
106106
# Expression-level preferences
107-
dotnet_style_object_initializer = true:warning
108-
dotnet_style_collection_initializer = true:warning
107+
dotnet_style_object_initializer = true:error
108+
dotnet_style_collection_initializer = true:error
109109
dotnet_style_explicit_tuple_names = true:warning
110110
dotnet_style_prefer_inferred_tuple_names = true:warning
111111
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
@@ -135,9 +135,9 @@ csharp_style_prefer_null_check_over_type_check = true:warning
135135
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#c-style-rules
136136
[*.{cs,csx,cake}]
137137
# 'var' preferences
138-
csharp_style_var_for_built_in_types = false:warning
139-
csharp_style_var_when_type_is_apparent = false:warning
140-
csharp_style_var_elsewhere = false:warning
138+
csharp_style_var_for_built_in_types = false:error
139+
csharp_style_var_when_type_is_apparent = false:error
140+
csharp_style_var_elsewhere = false:error
141141
# Expression-bodied members
142142
csharp_style_expression_bodied_methods = true:warning
143143
csharp_style_expression_bodied_constructors = true:warning
@@ -160,7 +160,10 @@ csharp_style_pattern_local_over_anonymous_function = true:warning
160160
csharp_style_deconstructed_variable_declaration = true:warning
161161
csharp_style_prefer_index_operator = true:warning
162162
csharp_style_prefer_range_operator = true:warning
163-
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
163+
csharp_style_implicit_object_creation_when_type_is_apparent = true:error
164+
# ReSharper inspection severities
165+
resharper_arrange_object_creation_when_type_evident_highlighting = error
166+
resharper_arrange_object_creation_when_type_not_evident_highlighting = error
164167
# "Null" checking preferences
165168
csharp_style_throw_expression = true:warning
166169
csharp_style_conditional_delegate_call = true:warning
@@ -172,6 +175,11 @@ dotnet_diagnostic.IDE0063.severity = suggestion
172175
csharp_using_directive_placement = outside_namespace:warning
173176
# Modifier preferences
174177
csharp_prefer_static_local_function = true:warning
178+
# Primary constructor preferences
179+
csharp_style_prefer_primary_constructors = false:none
180+
# Collection preferences
181+
dotnet_style_prefer_collection_expression = true:error
182+
resharper_use_collection_expression_highlighting =true:error
175183

176184
##########################################
177185
# Unnecessary Code Rules

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@
133133
*.pnm filter=lfs diff=lfs merge=lfs -text
134134
*.wbmp filter=lfs diff=lfs merge=lfs -text
135135
*.exr filter=lfs diff=lfs merge=lfs -text
136+
*.ico filter=lfs diff=lfs merge=lfs -text
137+
*.cur filter=lfs diff=lfs merge=lfs -text
138+
*.ani filter=lfs diff=lfs merge=lfs -text
139+
*.heic filter=lfs diff=lfs merge=lfs -text
140+
*.hif filter=lfs diff=lfs merge=lfs -text
141+
*.avif filter=lfs diff=lfs merge=lfs -text
142+
###############################################################################
143+
# Handle ICC files by git lfs
144+
###############################################################################
145+
*.icc filter=lfs diff=lfs merge=lfs -text

.github/ISSUE_TEMPLATE/commercial-bug-report.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/build-and-test.yml

Lines changed: 79 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,125 @@ on:
44
push:
55
branches:
66
- main
7+
- release/*
78
tags:
89
- "v*"
910
pull_request:
1011
branches:
1112
- main
13+
- release/*
1214
types: [ labeled, opened, synchronize, reopened ]
15+
1316
jobs:
17+
# Prime a single LFS cache and expose the exact key for the matrix
18+
WarmLFS:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
22+
steps:
23+
- name: Git Config
24+
shell: bash
25+
run: |
26+
git config --global core.autocrlf false
27+
git config --global core.longpaths true
28+
29+
- name: Git Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
submodules: recursive
34+
35+
# Deterministic list of LFS object IDs, then compute a portable key:
36+
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
37+
# - `awk '{print $1}'` extracts just the SHA field
38+
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
39+
# This ensures the file content is identical regardless of OS or locale
40+
- name: Git Create LFS id list
41+
shell: bash
42+
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id
43+
44+
- name: Git Expose LFS cache key
45+
id: expose-key
46+
shell: bash
47+
env:
48+
LFS_KEY: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
49+
run: echo "lfs_key=$LFS_KEY" >> "$GITHUB_OUTPUT"
50+
51+
- name: Git Setup LFS Cache
52+
uses: actions/cache@v4
53+
with:
54+
path: .git/lfs
55+
key: ${{ steps.expose-key.outputs.lfs_key }}
56+
57+
- name: Git Pull LFS
58+
shell: bash
59+
run: git lfs pull
60+
1461
Build:
62+
needs: WarmLFS
1563
strategy:
1664
matrix:
1765
isARM:
1866
- ${{ contains(github.event.pull_request.labels.*.name, 'arch:arm32') || contains(github.event.pull_request.labels.*.name, 'arch:arm64') }}
1967
options:
2068
- os: ubuntu-latest
21-
framework: net7.0
22-
sdk: 7.0.x
69+
framework: net9.0
70+
sdk: 9.0.x
2371
sdk-preview: true
2472
runtime: -x64
2573
codecov: false
2674
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
27-
framework: net7.0
28-
sdk: 7.0.x
75+
framework: net9.0
76+
sdk: 9.0.x
2977
sdk-preview: true
3078
runtime: -x64
3179
codecov: false
3280
- os: windows-latest
33-
framework: net7.0
34-
sdk: 7.0.x
81+
framework: net9.0
82+
sdk: 9.0.x
3583
sdk-preview: true
3684
runtime: -x64
3785
codecov: false
3886
- os: buildjet-4vcpu-ubuntu-2204-arm
39-
framework: net7.0
40-
sdk: 7.0.x
87+
framework: net9.0
88+
sdk: 9.0.x
4189
sdk-preview: true
4290
runtime: -x64
4391
codecov: false
92+
4493
- os: ubuntu-latest
45-
framework: net6.0
46-
sdk: 6.0.x
94+
framework: net8.0
95+
sdk: 8.0.x
4796
runtime: -x64
4897
codecov: false
4998
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
50-
framework: net6.0
51-
sdk: 6.0.x
99+
framework: net8.0
100+
sdk: 8.0.x
52101
runtime: -x64
53102
codecov: false
54103
- os: windows-latest
55-
framework: net6.0
56-
sdk: 6.0.x
104+
framework: net8.0
105+
sdk: 8.0.x
106+
runtime: -x64
107+
codecov: false
108+
- os: buildjet-4vcpu-ubuntu-2204-arm
109+
framework: net8.0
110+
sdk: 8.0.x
57111
runtime: -x64
58-
codecov: true
112+
codecov: false
59113
exclude:
60114
- isARM: false
61115
options:
62116
os: buildjet-4vcpu-ubuntu-2204-arm
63117

64-
runs-on: ${{matrix.options.os}}
118+
runs-on: ${{ matrix.options.os }}
65119

66120
steps:
67121
- name: Install libgdi+, which is required for tests running on ubuntu
68-
if: ${{ matrix.options.os == 'buildjet-4vcpu-ubuntu-2204-arm' }}
69-
run: sudo apt-get -y install libgdiplus libgif-dev libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
122+
if: ${{ contains(matrix.options.os, 'ubuntu') }}
123+
run: |
124+
sudo apt-get update
125+
sudo apt-get -y install libgdiplus libgif-dev libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
70126
71127
- name: Git Config
72128
shell: bash
@@ -80,18 +136,15 @@ jobs:
80136
fetch-depth: 0
81137
submodules: recursive
82138

83-
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
84-
- name: Git Create LFS FileList
85-
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
86-
139+
# Use the warmed key from WarmLFS. Do not recompute or recreate .lfs-assets-id here.
87140
- name: Git Setup LFS Cache
88141
uses: actions/cache@v4
89-
id: lfs-cache
90142
with:
91143
path: .git/lfs
92-
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
144+
key: ${{ needs.WarmLFS.outputs.lfs_key }}
93145

94146
- name: Git Pull LFS
147+
shell: bash
95148
run: git lfs pull
96149

97150
- name: NuGet Install
@@ -110,14 +163,14 @@ jobs:
110163
uses: actions/setup-dotnet@v4
111164
with:
112165
dotnet-version: |
113-
6.0.x
166+
8.0.x
114167
115168
- name: DotNet Setup Preview
116169
if: ${{ matrix.options.sdk-preview == true }}
117170
uses: actions/setup-dotnet@v4
118171
with:
119172
dotnet-version: |
120-
7.0.x
173+
9.0.x
121174
122175
- name: DotNet Build
123176
if: ${{ matrix.options.sdk-preview != true }}
@@ -165,11 +218,8 @@ jobs:
165218

166219
Publish:
167220
needs: [Build]
168-
169221
runs-on: ubuntu-latest
170-
171222
if: (github.event_name == 'push')
172-
173223
steps:
174224
- name: Git Config
175225
shell: bash
@@ -210,4 +260,3 @@ jobs:
210260
run: |
211261
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
212262
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
213-

ImageSharp.Drawing.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.31903.59
4+
VisualStudioVersion = 17.14.36623.8 d17.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
77
ProjectSection(SolutionItems) = preProject
@@ -28,7 +28,7 @@ EndProject
2828
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{FBE8C1AD-5AEC-4514-9B64-091D8E145865}"
2929
ProjectSection(SolutionItems) = preProject
3030
.github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
31-
.github\ISSUE_TEMPLATE\oss-bug-report.md = .github\ISSUE_TEMPLATE\oss-bug-report.md
31+
.github\ISSUE_TEMPLATE\oss-bug-report.yml = .github\ISSUE_TEMPLATE\oss-bug-report.yml
3232
EndProjectSection
3333
EndProject
3434
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{815C0625-CD3D-440F-9F80-2D83856AB7AE}"

samples/DrawShapesWithImageSharp/DrawShapesWithImageSharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<Choose>
99
<When Condition="$(SIXLABORS_TESTING_PREVIEW) == true">
1010
<PropertyGroup>
11-
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
11+
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
1212
</PropertyGroup>
1313
</When>
1414
<Otherwise>
1515
<PropertyGroup>
16-
<TargetFrameworks>net6.0</TargetFrameworks>
16+
<TargetFrameworks>net8.0</TargetFrameworks>
1717
</PropertyGroup>
1818
</Otherwise>
1919
</Choose>

samples/DrawShapesWithImageSharp/ImageSharpLogo.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public static void SaveLogo(float size, string path)
1717
// the point are based on a 1206x1206 shape so size requires scaling from there
1818
float scalingFactor = size / 1206;
1919

20-
var center = new Vector2(603);
20+
Vector2 center = new(603);
2121

2222
// segment whose center of rotation should be
23-
var segmentOffset = new Vector2(301.16968f, 301.16974f);
23+
Vector2 segmentOffset = new(301.16968f, 301.16974f);
2424
IPath segment = new Polygon(
2525
new LinearLineSegment(new Vector2(230.54f, 361.0261f), new Vector2(5.8641942f, 361.46031f)),
2626
new CubicBezierLineSegment(
@@ -30,28 +30,28 @@ public static void SaveLogo(float size, string path)
3030
new Vector2(78.26f, 97.0461f))).Translate(center - segmentOffset);
3131

3232
// we need to create 6 of theses all rotated about the center point
33-
var segments = new List<IPath>();
33+
List<IPath> segments = [];
3434
for (int i = 0; i < 6; i++)
3535
{
3636
float angle = i * ((float)Math.PI / 3);
3737
IPath s = segment.Transform(Matrix3x2.CreateRotation(angle, center));
3838
segments.Add(s);
3939
}
4040

41-
var colors = new List<Color>()
42-
{
41+
List<Color> colors =
42+
[
4343
Color.ParseHex("35a849"),
4444
Color.ParseHex("fcee21"),
4545
Color.ParseHex("ed7124"),
4646
Color.ParseHex("cb202d"),
4747
Color.ParseHex("5f2c83"),
48-
Color.ParseHex("085ba7"),
49-
};
48+
Color.ParseHex("085ba7")
49+
];
5050

51-
var scaler = Matrix3x2.CreateScale(scalingFactor, Vector2.Zero);
51+
Matrix3x2 scaler = Matrix3x2.CreateScale(scalingFactor, Vector2.Zero);
5252

5353
int dimensions = (int)Math.Ceiling(size);
54-
using (var img = new Image<Rgba32>(dimensions, dimensions))
54+
using (Image<Rgba32> img = new(dimensions, dimensions))
5555
{
5656
img.Mutate(i => i.Fill(Color.Black));
5757
img.Mutate(i => i.Fill(Color.ParseHex("e1e1e1ff"), new EllipsePolygon(center, 600f).Transform(scaler)));
@@ -62,7 +62,7 @@ public static void SaveLogo(float size, string path)
6262
img.Mutate(i => i.Fill(colors[s], segments[s].Transform(scaler)));
6363
}
6464

65-
img.Mutate(i => i.Fill(new Rgba32(0, 0, 0, 170), new ComplexPolygon(new EllipsePolygon(center, 161f), new EllipsePolygon(center, 61f)).Transform(scaler)));
65+
img.Mutate(i => i.Fill(Color.FromPixel(new Rgba32(0, 0, 0, 170)), new ComplexPolygon(new EllipsePolygon(center, 161f), new EllipsePolygon(center, 61f)).Transform(scaler)));
6666

6767
string fullPath = System.IO.Path.GetFullPath(System.IO.Path.Combine("Output", path));
6868

0 commit comments

Comments
 (0)