diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-26 14:12:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-26 14:12:40 -0500 |
| commit | e051ca6ff6d6dd216bb307c316cf106d4409f1b0 (patch) | |
| tree | 34de1fd8fb3735835fb30dc634a7cea9088521aa /Emby.Drawing/SkiaEncoder.cs | |
| parent | d1a0497f55c7f41fe9f01bbed328967e381fd394 (diff) | |
| parent | 883575893b3f4a4224f920e8c143a9edefca13e4 (diff) | |
Merge pull request #721 from Bond-009/imagedimensions
Change image dimentions from double to int
Diffstat (limited to 'Emby.Drawing/SkiaEncoder.cs')
| -rw-r--r-- | Emby.Drawing/SkiaEncoder.cs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Emby.Drawing/SkiaEncoder.cs b/Emby.Drawing/SkiaEncoder.cs index 9883b3cca..aae10f6cc 100644 --- a/Emby.Drawing/SkiaEncoder.cs +++ b/Emby.Drawing/SkiaEncoder.cs @@ -168,18 +168,14 @@ namespace Emby.Drawing } } - public ImageSize GetImageSize(string path) + public ImageDimensions GetImageSize(string path) { using (var s = new SKFileStream(path)) using (var codec = SKCodec.Create(s)) { var info = codec.Info; - return new ImageSize - { - Width = info.Width, - Height = info.Height - }; + return new ImageDimensions(info.Width, info.Height); } } @@ -513,7 +509,7 @@ namespace Emby.Drawing //_logger.LogInformation("Color type {0}", bitmap.Info.ColorType); - var originalImageSize = new ImageSize(bitmap.Width, bitmap.Height); + var originalImageSize = new ImageDimensions(bitmap.Width, bitmap.Height); if (!options.CropWhiteSpace && options.HasDefaultOptions(inputPath, originalImageSize) && !autoOrient) { @@ -523,8 +519,8 @@ namespace Emby.Drawing var newImageSize = ImageHelper.GetNewImageSize(options, originalImageSize); - var width = Convert.ToInt32(Math.Round(newImageSize.Width)); - var height = Convert.ToInt32(Math.Round(newImageSize.Height)); + var width = newImageSize.Width; + var height = newImageSize.Height; using (var resizedBitmap = new SKBitmap(width, height))//, bitmap.ColorType, bitmap.AlphaType)) { @@ -626,7 +622,7 @@ namespace Emby.Drawing { try { - var currentImageSize = new ImageSize(imageWidth, imageHeight); + var currentImageSize = new ImageDimensions(imageWidth, imageHeight); if (options.AddPlayedIndicator) { |
