aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-05-11 01:17:42 -0400
committerGitHub <noreply@github.com>2017-05-11 01:17:42 -0400
commite06563831e0f7a5e9a6120ab16decb05a0cde8f7 (patch)
treed4fc4e8ea083d796e598f157ec3c326cc7e706f1 /Emby.Drawing/ImageProcessor.cs
parent6ee9da3717a563d110fc56c93478885d19449cce (diff)
parent5d027aabd91131afb53ce530c5c7cc9f23274258 (diff)
Merge pull request #2629 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index accabcf14..9dc5f75ee 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -225,8 +225,8 @@ namespace Emby.Drawing
if (!_fileSystem.FileExists(cacheFilePath))
{
- var newWidth = Convert.ToInt32(newSize.Width);
- var newHeight = Convert.ToInt32(newSize.Height);
+ var newWidth = Convert.ToInt32(Math.Round(newSize.Width));
+ var newHeight = Convert.ToInt32(Math.Round(newSize.Height));
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath));
var tmpPath = Path.ChangeExtension(Path.Combine(_appPaths.TempDirectory, Guid.NewGuid().ToString("N")), Path.GetExtension(cacheFilePath));
@@ -339,13 +339,13 @@ namespace Emby.Drawing
if (width.HasValue)
{
- var heightValue = aspect / width.Value;
- return new ImageSize(width.Value, Convert.ToInt32(heightValue));
+ var heightValue = width.Value / aspect;
+ return new ImageSize(width.Value, heightValue);
}
var height = options.Height ?? options.MaxHeight ?? 200;
var widthValue = aspect * height;
- return new ImageSize(Convert.ToInt32(widthValue), height);
+ return new ImageSize(widthValue, height);
}
private double GetEstimatedAspectRatio(ImageType type)