Skip to content

Commit e852621

Browse files
Merge pull request #305 from SixLabors/js/imagesharpV3
Update to Imagesharp v3
2 parents d91883f + bc1e923 commit e852621

File tree

84 files changed

+346
-333
lines changed

Some content is hidden

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

84 files changed

+346
-333
lines changed

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,19 @@
6464
# Set explicit file behavior to:
6565
# treat as text
6666
# normalize to Unix-style line endings and
67-
# use a union merge when resoling conflicts
67+
# use a union merge when resolving conflicts
6868
###############################################################################
6969
*.csproj text eol=lf merge=union
7070
*.dbproj text eol=lf merge=union
7171
*.fsproj text eol=lf merge=union
7272
*.ncrunchproject text eol=lf merge=union
7373
*.vbproj text eol=lf merge=union
74+
*.shproj text eol=lf merge=union
7475
###############################################################################
7576
# Set explicit file behavior to:
7677
# treat as text
7778
# normalize to Windows-style line endings and
78-
# use a union merge when resoling conflicts
79+
# use a union merge when resolving conflicts
7980
###############################################################################
8081
*.sln text eol=crlf merge=union
8182
###############################################################################

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,15 @@ jobs:
189189
shell: pwsh
190190
run: ./ci-pack.ps1
191191

192-
- name: MyGet Publish
192+
- name: Feedz Publish
193193
shell: pwsh
194194
run: |
195-
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v2/package
196-
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v3/index.json
197-
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
195+
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
196+
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate
197+
198+
- name: NuGet Publish
199+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
200+
shell: pwsh
201+
run: |
202+
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
203+
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ For more information, see the [.NET Foundation Code of Conduct](https://dotnetfo
4545

4646
### Installation
4747

48-
Install stable releases via Nuget; development releases are available via MyGet.
48+
Install stable releases via Nuget; development releases are available via Feedz.io.
4949

50-
| Package Name | Release (NuGet) | Nightly (MyGet) |
50+
| Package Name | Release (NuGet) | Nightly (Feedz.io) |
5151
|--------------------------------|-----------------|-----------------|
52-
| `SixLabors.ImageSharp.Web` | [![NuGet](https://img.shields.io/nuget/v/SixLabors.ImageSharp.Web.svg)](https://www.nuget.org/packages/SixLabors.ImageSharp.Web/) | [![MyGet](https://img.shields.io/myget/sixlabors/vpre/SixLabors.ImageSharp.Web.svg)](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp.Web) |
52+
| `SixLabors.ImageSharp.Web` | [![NuGet](https://img.shields.io/nuget/v/SixLabors.ImageSharp.Web.svg)](https://www.nuget.org/packages/SixLabors.ImageSharp.Web/) | [![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https%3A%2F%2Ff.feedz.io%2Fsixlabors%2Fsixlabors%2Fshield%2FSixLabors.ImageSharp.Web%2Flatest)](https://f.feedz.io/sixlabors/sixlabors/nuget/index.json) |
5353

5454
## Manual build
5555

ci-pack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dotnet clean -c Release
33
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
44

55
# Building for packing and publishing.
6-
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl
6+
dotnet pack -c Release -p:PackageOutputPath="$PSScriptRoot/artifacts" -p:RepositoryUrl=$repositoryUrl

samples/ImageSharp.Web.Sample/Startup.cs

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -30,50 +30,44 @@ public class Startup
3030
/// </summary>
3131
/// <param name="services">The collection of service descriptors.</param>
3232
public void ConfigureServices(IServiceCollection services)
33-
{
34-
services.AddImageSharp()
35-
.SetRequestParser<QueryCollectionRequestParser>()
36-
.Configure<PhysicalFileSystemCacheOptions>(options =>
37-
{
38-
options.CacheRootPath = null;
39-
options.CacheFolder = "is-cache";
40-
options.CacheFolderDepth = 8;
41-
})
42-
.SetCache<PhysicalFileSystemCache>()
43-
.SetCacheKey<UriRelativeLowerInvariantCacheKey>()
44-
.SetCacheHash<SHA256CacheHash>()
45-
.Configure<PhysicalFileSystemProviderOptions>(options =>
46-
{
47-
options.ProviderRootPath = null;
48-
})
49-
.AddProvider<PhysicalFileSystemProvider>()
50-
.AddProcessor<ResizeWebProcessor>()
51-
.AddProcessor<FormatWebProcessor>()
52-
.AddProcessor<BackgroundColorWebProcessor>()
53-
.AddProcessor<QualityWebProcessor>()
54-
.AddProcessor<AutoOrientWebProcessor>();
33+
=> services.AddImageSharp()
34+
.SetRequestParser<QueryCollectionRequestParser>()
35+
.Configure<PhysicalFileSystemCacheOptions>(options =>
36+
{
37+
options.CacheRootPath = null;
38+
options.CacheFolder = "is-cache";
39+
options.CacheFolderDepth = 8;
40+
})
41+
.SetCache<PhysicalFileSystemCache>()
42+
.SetCacheKey<UriRelativeLowerInvariantCacheKey>()
43+
.SetCacheHash<SHA256CacheHash>()
44+
.Configure<PhysicalFileSystemProviderOptions>(options => options.ProviderRootPath = null)
45+
.AddProvider<PhysicalFileSystemProvider>()
46+
.AddProcessor<ResizeWebProcessor>()
47+
.AddProcessor<FormatWebProcessor>()
48+
.AddProcessor<BackgroundColorWebProcessor>()
49+
.AddProcessor<QualityWebProcessor>()
50+
.AddProcessor<AutoOrientWebProcessor>();
5551

56-
// Add the default service and options.
57-
//
58-
// services.AddImageSharp();
52+
// Add the default service and options.
53+
//
54+
// services.AddImageSharp();
5955

60-
// Or add the default service and custom options.
61-
//
62-
// this.ConfigureDefaultServicesAndCustomOptions(services);
56+
// Or add the default service and custom options.
57+
//
58+
// this.ConfigureDefaultServicesAndCustomOptions(services);
6359

64-
// Or we can fine-grain control adding the default options and configure all other services.
65-
//
66-
// this.ConfigureCustomServicesAndDefaultOptions(services);
60+
// Or we can fine-grain control adding the default options and configure all other services.
61+
//
62+
// this.ConfigureCustomServicesAndDefaultOptions(services);
6763

68-
// Or we can fine-grain control adding custom options and configure all other services
69-
// There are also factory methods for each builder that will allow building from configuration files.
70-
//
71-
// this.ConfigureCustomServicesAndCustomOptions(services);
72-
}
64+
// Or we can fine-grain control adding custom options and configure all other services
65+
// There are also factory methods for each builder that will allow building from configuration files.
66+
//
67+
// this.ConfigureCustomServicesAndCustomOptions(services);
7368

7469
private void ConfigureDefaultServicesAndCustomOptions(IServiceCollection services)
75-
{
76-
services.AddImageSharp(options =>
70+
=> services.AddImageSharp(options =>
7771
{
7872
options.Configuration = Configuration.Default;
7973
options.BrowserMaxAge = TimeSpan.FromDays(7);
@@ -84,18 +78,14 @@ private void ConfigureDefaultServicesAndCustomOptions(IServiceCollection service
8478
options.OnProcessedAsync = _ => Task.CompletedTask;
8579
options.OnPrepareResponseAsync = _ => Task.CompletedTask;
8680
});
87-
}
8881

8982
private void ConfigureCustomServicesAndDefaultOptions(IServiceCollection services)
90-
{
91-
services.AddImageSharp()
92-
.RemoveProcessor<FormatWebProcessor>()
93-
.RemoveProcessor<BackgroundColorWebProcessor>();
94-
}
83+
=> services.AddImageSharp()
84+
.RemoveProcessor<FormatWebProcessor>()
85+
.RemoveProcessor<BackgroundColorWebProcessor>();
9586

9687
private void ConfigureCustomServicesAndCustomOptions(IServiceCollection services)
97-
{
98-
services.AddImageSharp(options =>
88+
=> services.AddImageSharp(options =>
9989
{
10090
options.Configuration = Configuration.Default;
10191
options.BrowserMaxAge = TimeSpan.FromDays(7);
@@ -107,10 +97,7 @@ private void ConfigureCustomServicesAndCustomOptions(IServiceCollection services
10797
options.OnPrepareResponseAsync = _ => Task.CompletedTask;
10898
})
10999
.SetRequestParser<QueryCollectionRequestParser>()
110-
.Configure<PhysicalFileSystemCacheOptions>(options =>
111-
{
112-
options.CacheFolder = "different-cache";
113-
})
100+
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = "different-cache")
114101
.SetCache<PhysicalFileSystemCache>()
115102
.SetCacheKey<UriRelativeLowerInvariantCacheKey>()
116103
.SetCacheHash<SHA256CacheHash>()
@@ -121,7 +108,6 @@ private void ConfigureCustomServicesAndCustomOptions(IServiceCollection services
121108
.AddProcessor<FormatWebProcessor>()
122109
.AddProcessor<BackgroundColorWebProcessor>()
123110
.AddProcessor<QualityWebProcessor>();
124-
}
125111

126112
/// <summary>
127113
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

src/ImageSharp.Web.Providers.AWS/AmazonS3ClientFactory.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal static class AmazonS3ClientFactory
1818
/// <returns>
1919
/// A new <see cref="AmazonS3Client"/>.
2020
/// </returns>
21+
/// <exception cref="ArgumentException">Invalid configuration.</exception>
2122
public static AmazonS3Client CreateClient(IAWSS3BucketClientOptions options)
2223
{
2324
if (!string.IsNullOrWhiteSpace(options.Endpoint))
@@ -33,14 +34,14 @@ public static AmazonS3Client CreateClient(IAWSS3BucketClientOptions options)
3334
{
3435
// AccessSecret can be empty.
3536
Guard.NotNullOrWhiteSpace(options.Region, nameof(options.Region));
36-
var region = RegionEndpoint.GetBySystemName(options.Region);
37+
RegionEndpoint region = RegionEndpoint.GetBySystemName(options.Region);
3738
AmazonS3Config config = new() { RegionEndpoint = region, UseAccelerateEndpoint = options.UseAccelerateEndpoint };
3839
SetTimeout(config, options.Timeout);
3940
return new AmazonS3Client(options.AccessKey, options.AccessSecret, config);
4041
}
4142
else if (!string.IsNullOrWhiteSpace(options.Region))
4243
{
43-
var region = RegionEndpoint.GetBySystemName(options.Region);
44+
RegionEndpoint region = RegionEndpoint.GetBySystemName(options.Region);
4445
AmazonS3Config config = new() { RegionEndpoint = region, UseAccelerateEndpoint = options.UseAccelerateEndpoint };
4546
SetTimeout(config, options.Timeout);
4647
return new AmazonS3Client(config);

src/ImageSharp.Web/AsyncHelper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Globalization;
65

src/ImageSharp.Web/Caching/HexEncoder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
using System.Runtime.CompilerServices;
65
using System.Runtime.InteropServices;

src/ImageSharp.Web/Caching/ICacheHash.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3-
#nullable disable
43

54
namespace SixLabors.ImageSharp.Web.Caching;
65

0 commit comments

Comments
 (0)