Remove all ImageSharp.Web Processors and the re-add in the correct order

This commit is contained in:
Jeavon Leopold
2021-10-01 16:15:49 +01:00
committed by Nathan Woulfe
parent 23d2106277
commit a3744f90de

View File

@@ -54,8 +54,14 @@ namespace Umbraco.Extensions
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = builder.BuilderHostingEnvironment.MapPathContentRoot(imagingSettings.Cache.CacheFolder))
// We need to add CropWebProcessor before ResizeWebProcessor (until https://github.com/SixLabors/ImageSharp.Web/issues/182 is fixed)
.RemoveProcessor<ResizeWebProcessor>()
.RemoveProcessor<FormatWebProcessor>()
.RemoveProcessor<BackgroundColorWebProcessor>()
.RemoveProcessor<JpegQualityWebProcessor>()
.AddProcessor<CropWebProcessor>()
.AddProcessor<ResizeWebProcessor>();
.AddProcessor<ResizeWebProcessor>()
.AddProcessor<FormatWebProcessor>()
.AddProcessor<BackgroundColorWebProcessor>()
.AddProcessor<JpegQualityWebProcessor>();
builder.Services.AddTransient<IConfigureOptions<ImageSharpMiddlewareOptions>, ImageSharpConfigurationOptions>();