Skip to content

Commit fbce0fa

Browse files
Merge branch 'main' into js/affine-bounds-fixes
2 parents c579547 + 63f5351 commit fbce0fa

893 files changed

Lines changed: 24369 additions & 29328 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ dotnet_diagnostic.IDE0063.severity = suggestion
172172
csharp_using_directive_placement = outside_namespace:warning
173173
# Modifier preferences
174174
csharp_prefer_static_local_function = true:warning
175+
# Primary constructor preferences
176+
csharp_style_prefer_primary_constructors = false:none
175177

176178
##########################################
177179
# Unnecessary Code Rules

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,6 @@
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

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

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,23 @@ jobs:
2020
- ${{ contains(github.event.pull_request.labels.*.name, 'arch:arm32') || contains(github.event.pull_request.labels.*.name, 'arch:arm64') }}
2121
options:
2222
- os: ubuntu-latest
23-
framework: net7.0
24-
sdk: 7.0.x
25-
sdk-preview: true
23+
framework: net8.0
24+
sdk: 8.0.x
2625
runtime: -x64
2726
codecov: false
2827
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
29-
framework: net7.0
30-
sdk: 7.0.x
31-
sdk-preview: true
28+
framework: net8.0
29+
sdk: 8.0.x
3230
runtime: -x64
3331
codecov: false
3432
- os: windows-latest
35-
framework: net7.0
36-
sdk: 7.0.x
37-
sdk-preview: true
33+
framework: net8.0
34+
sdk: 8.0.x
3835
runtime: -x64
3936
codecov: false
4037
- os: buildjet-4vcpu-ubuntu-2204-arm
41-
framework: net7.0
42-
sdk: 7.0.x
43-
sdk-preview: true
44-
runtime: -x64
45-
codecov: false
46-
- os: ubuntu-latest
47-
framework: net6.0
48-
sdk: 6.0.x
49-
runtime: -x64
50-
codecov: false
51-
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
52-
framework: net6.0
53-
sdk: 6.0.x
54-
runtime: -x64
55-
codecov: false
56-
- os: windows-latest
57-
framework: net6.0
58-
sdk: 6.0.x
38+
framework: net8.0
39+
sdk: 8.0.x
5940
runtime: -x64
6041
codecov: false
6142
exclude:
@@ -87,7 +68,7 @@ jobs:
8768
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
8869

8970
- name: Git Setup LFS Cache
90-
uses: actions/cache@v3
71+
uses: actions/cache@v4
9172
id: lfs-cache
9273
with:
9374
path: .git/lfs
@@ -97,10 +78,10 @@ jobs:
9778
run: git lfs pull
9879

9980
- name: NuGet Install
100-
uses: NuGet/setup-nuget@v1
81+
uses: NuGet/setup-nuget@v2
10182

10283
- name: NuGet Setup Cache
103-
uses: actions/cache@v3
84+
uses: actions/cache@v4
10485
id: nuget-cache
10586
with:
10687
path: ~/.nuget
@@ -109,17 +90,17 @@ jobs:
10990

11091
- name: DotNet Setup
11192
if: ${{ matrix.options.sdk-preview != true }}
112-
uses: actions/setup-dotnet@v3
93+
uses: actions/setup-dotnet@v4
11394
with:
11495
dotnet-version: |
115-
6.0.x
96+
8.0.x
11697
11798
- name: DotNet Setup Preview
11899
if: ${{ matrix.options.sdk-preview == true }}
119-
uses: actions/setup-dotnet@v3
100+
uses: actions/setup-dotnet@v4
120101
with:
121102
dotnet-version: |
122-
7.0.x
103+
8.0.x
123104
124105
- name: DotNet Build
125106
if: ${{ matrix.options.sdk-preview != true }}
@@ -152,7 +133,7 @@ jobs:
152133
XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit
153134

154135
- name: Export Failed Output
155-
uses: actions/upload-artifact@v3
136+
uses: actions/upload-artifact@v4
156137
if: failure()
157138
with:
158139
name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip
@@ -179,10 +160,10 @@ jobs:
179160
submodules: recursive
180161

181162
- name: NuGet Install
182-
uses: NuGet/setup-nuget@v1
163+
uses: NuGet/setup-nuget@v2
183164

184165
- name: NuGet Setup Cache
185-
uses: actions/cache@v3
166+
uses: actions/cache@v4
186167
id: nuget-cache
187168
with:
188169
path: ~/.nuget

.github/workflows/code-coverage.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
options:
1212
- os: ubuntu-latest
13-
framework: net6.0
13+
framework: net8.0
1414
runtime: -x64
1515
codecov: true
1616

@@ -34,7 +34,7 @@ jobs:
3434
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
3535

3636
- name: Git Setup LFS Cache
37-
uses: actions/cache@v3
37+
uses: actions/cache@v4
3838
id: lfs-cache
3939
with:
4040
path: .git/lfs
@@ -44,21 +44,21 @@ jobs:
4444
run: git lfs pull
4545

4646
- name: NuGet Install
47-
uses: NuGet/setup-nuget@v1
47+
uses: NuGet/setup-nuget@v2
4848

4949
- name: NuGet Setup Cache
50-
uses: actions/cache@v3
50+
uses: actions/cache@v4
5151
id: nuget-cache
5252
with:
5353
path: ~/.nuget
5454
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
5555
restore-keys: ${{ runner.os }}-nuget-
5656

5757
- name: DotNet Setup
58-
uses: actions/setup-dotnet@v3
58+
uses: actions/setup-dotnet@v4
5959
with:
6060
dotnet-version: |
61-
6.0.x
61+
8.0.x
6262
6363
- name: DotNet Build
6464
shell: pwsh
@@ -74,14 +74,14 @@ jobs:
7474
XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit
7575

7676
- name: Export Failed Output
77-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7878
if: failure()
7979
with:
8080
name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip
8181
path: tests/Images/ActualOutput/
8282

8383
- name: Codecov Update
84-
uses: codecov/codecov-action@v3
84+
uses: codecov/codecov-action@v4
8585
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
8686
with:
8787
flags: unittests

ImageSharp.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{815C0625-CD3
3838
src\Directory.Build.props = src\Directory.Build.props
3939
src\Directory.Build.targets = src\Directory.Build.targets
4040
src\README.md = src\README.md
41+
src\ImageSharp.ruleset = src\ImageSharp.ruleset
4142
EndProjectSection
4243
EndProject
4344
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp", "src\ImageSharp\ImageSharp.csproj", "{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}"
@@ -237,6 +238,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "issues", "issues", "{5C9B68
237238
tests\Images\Input\Jpg\issues\issue750-exif-tranform.jpg = tests\Images\Input\Jpg\issues\issue750-exif-tranform.jpg
238239
tests\Images\Input\Jpg\issues\Issue845-Incorrect-Quality99.jpg = tests\Images\Input\Jpg\issues\Issue845-Incorrect-Quality99.jpg
239240
tests\Images\Input\Jpg\issues\issue855-incorrect-colorspace.jpg = tests\Images\Input\Jpg\issues\issue855-incorrect-colorspace.jpg
241+
tests\Images\Input\Jpg\issues\issue-2067-comment.jpg = tests\Images\Input\Jpg\issues\issue-2067-comment.jpg
240242
EndProjectSection
241243
EndProject
242244
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fuzz", "fuzz", "{516A3532-6AC2-417B-AD79-9BD5D0D378A0}"
@@ -659,6 +661,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Qoi", "Qoi", "{E801B508-493
659661
tests\Images\Input\Qoi\wikipedia_008.qoi = tests\Images\Input\Qoi\wikipedia_008.qoi
660662
EndProjectSection
661663
EndProject
664+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Icon", "Icon", "{95E45DDE-A67D-48AD-BBA8-5FAA151B860D}"
665+
ProjectSection(SolutionItems) = preProject
666+
tests\Images\Input\Icon\aero_arrow.cur = tests\Images\Input\Icon\aero_arrow.cur
667+
tests\Images\Input\Icon\flutter.ico = tests\Images\Input\Icon\flutter.ico
668+
EndProjectSection
669+
EndProject
662670
Global
663671
GlobalSection(SolutionConfigurationPlatforms) = preSolution
664672
Debug|Any CPU = Debug|Any CPU
@@ -712,6 +720,7 @@ Global
712720
{670DD46C-82E9-499A-B2D2-00A802ED0141} = {E1C42A6F-913B-4A7B-B1A8-2BB62843B254}
713721
{5DFC394F-136F-4B76-9BCA-3BA786515EFC} = {9DA226A1-8656-49A8-A58A-A8B5C081AD66}
714722
{E801B508-4935-41CD-BA85-CF11BFF55A45} = {9DA226A1-8656-49A8-A58A-A8B5C081AD66}
723+
{95E45DDE-A67D-48AD-BBA8-5FAA151B860D} = {9DA226A1-8656-49A8-A58A-A8B5C081AD66}
715724
EndGlobalSection
716725
GlobalSection(ExtensibilityGlobals) = postSolution
717726
SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Designed to simplify image processing, ImageSharp brings you an incredibly power
2121

2222
ImageSharp is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional operations.
2323

24-
Built against [.NET 6](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
24+
Built against [.NET 8](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
2525

2626

2727
## License
@@ -64,7 +64,7 @@ If you prefer, you can compile ImageSharp yourself (please do and help!)
6464

6565
- Using [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
6666
- Make sure you have the latest version installed
67-
- Make sure you have [the .NET 7 SDK](https://www.microsoft.com/net/core#windows) installed
67+
- Make sure you have [the .NET 8 SDK](https://www.microsoft.com/net/core#windows) installed
6868

6969
Alternatively, you can work from command line and/or with a lightweight editor on **both Linux/Unix and Windows**:
7070

src/ImageSharp.ruleset

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RuleSet Name="ImageSharp" ToolsVersion="17.0">
33
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
4-
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
5-
<Rule Id="SA1011" Action="None" />
6-
</Rules>
74
</RuleSet>

src/ImageSharp/Advanced/ParallelRowIterator.Wrappers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void Invoke(int i)
5151
for (int y = yMin; y < yMax; y++)
5252
{
5353
// Skip the safety copy when invoking a potentially impure method on a readonly field
54-
Unsafe.AsRef(this.action).Invoke(y);
54+
Unsafe.AsRef(in this.action).Invoke(y);
5555
}
5656
}
5757
}
@@ -102,7 +102,7 @@ public void Invoke(int i)
102102

103103
for (int y = yMin; y < yMax; y++)
104104
{
105-
Unsafe.AsRef(this.action).Invoke(y, span);
105+
Unsafe.AsRef(in this.action).Invoke(y, span);
106106
}
107107
}
108108
}

src/ImageSharp/Advanced/ParallelRowIterator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void IterateRows<T>(
5858
{
5959
for (int y = top; y < bottom; y++)
6060
{
61-
Unsafe.AsRef(operation).Invoke(y);
61+
Unsafe.AsRef(in operation).Invoke(y);
6262
}
6363

6464
return;
@@ -118,7 +118,7 @@ public static void IterateRows<T, TBuffer>(
118118
int maxSteps = DivideCeil(width * (long)height, parallelSettings.MinimumPixelsProcessedPerTask);
119119
int numOfSteps = Math.Min(parallelSettings.MaxDegreeOfParallelism, maxSteps);
120120
MemoryAllocator allocator = parallelSettings.MemoryAllocator;
121-
int bufferLength = Unsafe.AsRef(operation).GetRequiredBufferLength(rectangle);
121+
int bufferLength = Unsafe.AsRef(in operation).GetRequiredBufferLength(rectangle);
122122

123123
// Avoid TPL overhead in this trivial case:
124124
if (numOfSteps == 1)
@@ -128,7 +128,7 @@ public static void IterateRows<T, TBuffer>(
128128

129129
for (int y = top; y < bottom; y++)
130130
{
131-
Unsafe.AsRef(operation).Invoke(y, span);
131+
Unsafe.AsRef(in operation).Invoke(y, span);
132132
}
133133

134134
return;
@@ -245,15 +245,15 @@ public static void IterateRowIntervals<T, TBuffer>(
245245
int maxSteps = DivideCeil(width * (long)height, parallelSettings.MinimumPixelsProcessedPerTask);
246246
int numOfSteps = Math.Min(parallelSettings.MaxDegreeOfParallelism, maxSteps);
247247
MemoryAllocator allocator = parallelSettings.MemoryAllocator;
248-
int bufferLength = Unsafe.AsRef(operation).GetRequiredBufferLength(rectangle);
248+
int bufferLength = Unsafe.AsRef(in operation).GetRequiredBufferLength(rectangle);
249249

250250
// Avoid TPL overhead in this trivial case:
251251
if (numOfSteps == 1)
252252
{
253253
var rows = new RowInterval(top, bottom);
254254
using IMemoryOwner<TBuffer> buffer = allocator.Allocate<TBuffer>(bufferLength);
255255

256-
Unsafe.AsRef(operation).Invoke(in rows, buffer.Memory.Span);
256+
Unsafe.AsRef(in operation).Invoke(in rows, buffer.Memory.Span);
257257

258258
return;
259259
}

0 commit comments

Comments
 (0)