From afff226514a6f645a6738f1e407208826b84f1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Thu, 18 Mar 2021 23:40:45 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Cody Robibero --- MediaBrowser.Model/Drawing/DrawingUtils.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs index c2a144f817..5567927682 100644 --- a/MediaBrowser.Model/Drawing/DrawingUtils.cs +++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs @@ -87,8 +87,8 @@ namespace MediaBrowser.Model.Drawing fillHeight = 1; } - double widthRatio = (double)size.Width / (double)fillWidth; - double heightRatio = (double)size.Height / (double)fillHeight; + double widthRatio = size.Width / (double)fillWidth; + double heightRatio = size.Height / (double)fillHeight; double scaleRatio = Math.Min(widthRatio, heightRatio); // Clamp to current size. @@ -97,8 +97,8 @@ namespace MediaBrowser.Model.Drawing return size; } - int newWidth = Convert.ToInt32(Math.Ceiling((double)size.Width / scaleRatio)); - int newHeight = Convert.ToInt32(Math.Ceiling((double)size.Height / scaleRatio)); + int newWidth = Convert.ToInt32(Math.Ceiling(size.Width / scaleRatio)); + int newHeight = Convert.ToInt32(Math.Ceiling(size.Height / scaleRatio)); return new ImageDimensions(newWidth, newHeight); }