Remove repeated ImageSharp default configuration

This commit is contained in:
Ronald Barendse
2021-08-13 16:04:44 +02:00
parent 36568a0fdc
commit a0184d5556

View File

@@ -29,7 +29,6 @@ namespace Umbraco.Extensions
services.AddImageSharp(options => services.AddImageSharp(options =>
{ {
options.Configuration = SixLabors.ImageSharp.Configuration.Default;
options.BrowserMaxAge = imagingSettings.Cache.BrowserMaxAge; options.BrowserMaxAge = imagingSettings.Cache.BrowserMaxAge;
options.CacheMaxAge = imagingSettings.Cache.CacheMaxAge; options.CacheMaxAge = imagingSettings.Cache.CacheMaxAge;
options.CachedNameLength = imagingSettings.Cache.CachedNameLength; options.CachedNameLength = imagingSettings.Cache.CachedNameLength;
@@ -52,17 +51,12 @@ namespace Umbraco.Extensions
return Task.CompletedTask; return Task.CompletedTask;
}; };
options.OnBeforeSaveAsync = _ => Task.CompletedTask;
options.OnProcessedAsync = _ => Task.CompletedTask;
options.OnPrepareResponseAsync = _ => Task.CompletedTask;
}) })
.SetRequestParser<QueryCollectionRequestParser>()
.Configure<PhysicalFileSystemCacheOptions>(options => .Configure<PhysicalFileSystemCacheOptions>(options =>
{ {
options.CacheFolder = imagingSettings.Cache.CacheFolder; options.CacheFolder = imagingSettings.Cache.CacheFolder;
}) })
.SetCache<PhysicalFileSystemCache>() // We need to add CropWebProcessor before ResizeWebProcessor (until https://github.com/SixLabors/ImageSharp.Web/issues/182 is fixed)
.SetCacheHash<CacheHash>()
.RemoveProcessor<ResizeWebProcessor>() .RemoveProcessor<ResizeWebProcessor>()
.AddProcessor<CropWebProcessor>() .AddProcessor<CropWebProcessor>()
.AddProcessor<ResizeWebProcessor>(); .AddProcessor<ResizeWebProcessor>();