Skip to content

Commit 4660490

Browse files
NguyenThuyLanbergmania
authored andcommitted
Fix error format code (#17146)
* update ImageSharpMiddlewareOption for fixing invalid width and height (#17126) Co-authored-by: Lan Nguyen Thuy <[email protected]> * Fix issue format parameters --------- Co-authored-by: Lan Nguyen Thuy <[email protected]> (cherry picked from commit 9a12eea)
1 parent 762d72b commit 4660490

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ public void Configure(ImageSharpMiddlewareOptions options)
5151

5252
if (context.Commands.Contains(ResizeWebProcessor.Width))
5353
{
54-
if (!int.TryParse(context.Commands.GetValueOrDefault(ResizeWebProcessor.Width), NumberStyles.Integer,
55-
CultureInfo.InvariantCulture, out var width)
54+
if (!int.TryParse(
55+
context.Commands.GetValueOrDefault(ResizeWebProcessor.Width),
56+
NumberStyles.Integer,
57+
CultureInfo.InvariantCulture,
58+
out var width)
5659
|| width < 0
5760
|| width >= _imagingSettings.Resize.MaxWidth)
5861
{
@@ -62,8 +65,11 @@ public void Configure(ImageSharpMiddlewareOptions options)
6265

6366
if (context.Commands.Contains(ResizeWebProcessor.Height))
6467
{
65-
if (!int.TryParse(context.Commands.GetValueOrDefault(ResizeWebProcessor.Height), NumberStyles.Integer,
66-
CultureInfo.InvariantCulture, out var height)
68+
if (!int.TryParse(
69+
context.Commands.GetValueOrDefault(ResizeWebProcessor.Height),
70+
NumberStyles.Integer,
71+
CultureInfo.InvariantCulture,
72+
out var height)
6773
|| height < 0
6874
|| height >= _imagingSettings.Resize.MaxHeight)
6975
{

0 commit comments

Comments
 (0)