Skip to content

Update to SixLabors.ImageSharp.Web 1.0.4 and remove processing order workarounds #11349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
465e954
Update CONTRIBUTING.md (#11248)
julian-code Oct 2, 2021
e416f06
Change template helper to use async partials (#11243)
louisjrdev Oct 4, 2021
9abd071
Fix for Excessive header checker when excluding Cloudflare
Jeavon Sep 29, 2021
f29bda6
Cypress test for textbox max length (#11245)
jemayn Oct 5, 2021
bdfa54a
Changed the case of BlockList to blocklist as it breaks on *nix syste…
prjseal Oct 5, 2021
23d2106
Fixed missing null check in BlockEditorPropertyEditor (#11184)
lauraneto Oct 5, 2021
a3744f9
Remove all ImageSharp.Web Processors and the re-add in the correct order
Jeavon Oct 1, 2021
56c97e1
Add ModelsBuilder unit tests to cover Inheritance and Composition (#1…
JasonElkin Oct 6, 2021
b74bed3
Add test to update user
jmayntzhusen Oct 4, 2021
79fdb9a
Merge branch 'v9/dev' into v9/contrib
nul800sebastiaan Oct 8, 2021
e7da855
Added support for Smtp PickupDirectory (#11253)
louisjrdev Oct 9, 2021
bea143f
Allow local API when using AspNetCore identity
Oct 1, 2021
9f72b7b
Change references of Web.config to be appsettings.json (#11244)
louisjrdev Oct 10, 2021
9a5960b
Fixes (hides) customize button when connection string is already conf…
Oct 10, 2021
a2f0585
add cypress test for deleting a user (#11282)
jemayn Oct 10, 2021
10d1d3c
Update ImageSharp to version 1.0.4
brianpopow Oct 6, 2021
15aa713
Added missing GetCropUrl overload for MediaWithCrops (#11201)
lauraneto Oct 10, 2021
8989c4a
Add positioning context
greystate Oct 9, 2021
3dcfb6a
added vm. in front of the enterSubmitFolder method call on ng-keydown
prjseal Oct 7, 2021
49132e2
8258: Added create dictionary item button
patrickdemooij9 Oct 5, 2021
de12605
Remove remaining web.config references in translation files (#11344)
nul800sebastiaan Oct 11, 2021
4dd54a1
Update to SixLabors.ImageSharp.Web 1.0.4 and remove processing order …
ronaldbarendse Oct 11, 2021
83db6f5
Ensure crop coordinates are always added before focal point
ronaldbarendse Oct 12, 2021
e0701cc
Merge branch 'v9/dev' into v9/feature/update-imagesharp-web
Nov 24, 2021
c19463b
Revert changes in Umbraco.Web.Common.csproj
Nov 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ void AppendQueryString(string value)
void AddQueryString(string key, params IConvertible[] values)
=> AppendQueryString(key + '=' + string.Join(",", values.Select(x => x.ToString(CultureInfo.InvariantCulture))));

if (options.FocalPoint != null)
if (options.Crop != null)
{
AddQueryString("rxy", options.FocalPoint.Left, options.FocalPoint.Top);
AddQueryString("cc", options.Crop.Left, options.Crop.Top, options.Crop.Right, options.Crop.Bottom);
}

if (options.Crop != null)
if (options.FocalPoint != null)
{
AddQueryString("cc", options.Crop.Left, options.Crop.Top, options.Crop.Right, options.Crop.Bottom);
AddQueryString("rxy", options.FocalPoint.Left, options.FocalPoint.Top);
}

if (options.ImageCropMode.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static IServiceCollection AddUmbracoImageSharp(this IUmbracoBuilder build

builder.Services.AddImageSharp(options =>
{
// The configuration is set using ImageSharpConfigurationOptions
// options.Configuration is set using ImageSharpConfigurationOptions below
options.BrowserMaxAge = imagingSettings.Cache.BrowserMaxAge;
options.CacheMaxAge = imagingSettings.Cache.CacheMaxAge;
options.CachedNameLength = imagingSettings.Cache.CachedNameLength;
Expand All @@ -52,16 +52,7 @@ public static IServiceCollection AddUmbracoImageSharp(this IUmbracoBuilder build
};
})
.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<FormatWebProcessor>()
.AddProcessor<BackgroundColorWebProcessor>()
.AddProcessor<JpegQualityWebProcessor>();
.AddProcessor<CropWebProcessor>();

builder.Services.AddTransient<IConfigureOptions<ImageSharpMiddlewareOptions>, ImageSharpConfigurationOptions>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,14 @@ void AppendQueryString(string value)
void AddQueryString(string key, params IConvertible[] values)
=> AppendQueryString(key + '=' + string.Join(",", values.Select(x => x.ToString(CultureInfo.InvariantCulture))));

if (options.FocalPoint != null)
if (options.Crop != null)
{
AddQueryString("f", options.FocalPoint.Top, options.FocalPoint.Left);
AddQueryString("c", options.Crop.Left, options.Crop.Top, options.Crop.Right, options.Crop.Bottom);
}
else if (options.Crop != null)

if (options.FocalPoint != null)
{
AddQueryString("c", options.Crop.Left, options.Crop.Top, options.Crop.Right, options.Crop.Bottom);
AddQueryString("f", options.FocalPoint.Top, options.FocalPoint.Left);
}

if (options.ImageCropMode.HasValue)
Expand Down Expand Up @@ -399,7 +400,7 @@ void AddQueryString(string key, params IConvertible[] values)

if (options.CacheBusterValue != null)
{
AddQueryString("r", options.CacheBusterValue);
AddQueryString("v", options.CacheBusterValue);
}

return imageUrl.ToString();
Expand Down