Skip to content

Commit 09d38d8

Browse files
committed
updated imagesharp references, moved custom web processor from the core class library to the web project puckweb
1 parent 3299c3b commit 09d38d8

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

core/core.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
5555
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.0" />
5656
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.1" />
57-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0007" />
58-
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.0-beta0009" />
57+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0001" />
5958
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
6059
</ItemGroup>
6160

core/ImageSharp/WebProcessors/CropWebProcessor.cs renamed to puckweb/Areas/puck/ImageSharp/WebProcessors/CropWebProcessor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33

44
using System.Collections.Generic;
55
using Microsoft.Extensions.Logging;
6+
using SixLabors.ImageSharp;
67
using SixLabors.ImageSharp.Processing;
78
using SixLabors.ImageSharp.Processing.Processors.Transforms;
89
using SixLabors.ImageSharp.Web;
910
using SixLabors.ImageSharp.Web.Commands;
1011
using SixLabors.ImageSharp.Web.Processors;
11-
using SixLabors.Primitives;
12+
1213

1314
namespace puck.core.ImageSharp.WebProcessors
1415
{

puckweb/Startup.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
using puckweb.Data.Contexts;
3131
using puckweb.Data.Entities;
3232
using Microsoft.AspNetCore.Authentication.Cookies;
33+
using SixLabors.ImageSharp.Web.Providers.Azure;
3334

3435
namespace puckweb
3536
{
@@ -69,7 +70,7 @@ public void ConfigureServices(IServiceCollection services)
6970

7071
PhysicalFileSystemProvider PhysicalProviderFactory(IServiceProvider provider)
7172
{
72-
var env = provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>();
73+
var env = provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IWebHostEnvironment>();
7374
env.WebRootFileProvider = new PhysicalFileProvider(env.WebRootPath);
7475
var p = new PhysicalFileSystemProvider(
7576
env,
@@ -108,16 +109,19 @@ AzureBlobStorageImageProvider AzureProviderFactory(IServiceProvider provider)
108109
{
109110
return new PhysicalFileSystemCache(
110111
provider.GetRequiredService<IOptions<PhysicalFileSystemCacheOptions>>(),
111-
provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>(),
112+
provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IWebHostEnvironment>(),
112113
provider.GetRequiredService<IOptions<ImageSharpMiddlewareOptions>>(),
113114
provider.GetRequiredService<FormatUtilities>());
114115
})
115116
.SetCacheHash<CacheHash>()
116117
.AddProvider(AzureProviderFactory)
117118
.Configure<AzureBlobStorageImageProviderOptions>(options =>
118119
{
119-
options.ConnectionString = Configuration.GetValue<string>("AzureBlobStorageConnectionString");
120-
options.ContainerName = Configuration.GetValue<string>("AzureImageTransformer_ContainerName");
120+
options.BlobContainers.Add(new AzureBlobContainerClientOptions
121+
{
122+
ConnectionString = Configuration.GetValue<string>("AzureBlobStorageConnectionString"),
123+
ContainerName = Configuration.GetValue<string>("AzureImageTransformer_ContainerName")
124+
});
121125
})
122126
.AddProvider(PhysicalProviderFactory)
123127
.AddProcessor<CropWebProcessor>()
@@ -132,7 +136,7 @@ AzureBlobStorageImageProvider AzureProviderFactory(IServiceProvider provider)
132136
{
133137
return new PhysicalFileSystemCache(
134138
provider.GetRequiredService<IOptions<PhysicalFileSystemCacheOptions>>(),
135-
provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>(),
139+
provider.GetRequiredService<Microsoft.AspNetCore.Hosting.IWebHostEnvironment>(),
136140
provider.GetRequiredService<IOptions<ImageSharpMiddlewareOptions>>(),
137141
provider.GetRequiredService<FormatUtilities>());
138142
})

puckweb/puckweb.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.1.0" />
4343
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.0" />
4444
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.1" />
45-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0007" />
46-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0007" />
47-
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.0-beta0009" />
48-
<PackageReference Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="1.0.0-beta0009" />
45+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0001" />
46+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0008" />
47+
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.0-rc0001" />
48+
<PackageReference Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="1.0.0-rc0002" />
4949
</ItemGroup>
5050

5151
<Target Name="CopyCustomContentOnPublish" AfterTargets="Publish">

0 commit comments

Comments
 (0)