mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
Use more accurate rounding in GetFixedOutputSize (#11435)
* Use more accurate rounding in GetFixedOutputSize Signed-off-by: gnattu <gnattuoc@me.com> * Force trickplay thumbnails to have even width Signed-off-by: gnattu <gnattuoc@me.com> * Use Convert.ToInt32 Signed-off-by: gnattu <gnattuoc@me.com> * Force video size as thumbnail size if the trickplay width setting is larger This will fix an issue when the trickplay setting contains a very huge width, but the video has a lower resolution than that setting. Our scaling filter logic will not do any upscale, and we have to force to use the video width Signed-off-by: gnattu <gnattuoc@me.com> --------- Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
@@ -2984,8 +2984,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var scaleW = (double)maximumWidth / outputWidth;
|
||||
var scaleH = (double)maximumHeight / outputHeight;
|
||||
var scale = Math.Min(scaleW, scaleH);
|
||||
outputWidth = Math.Min(maximumWidth, (int)(outputWidth * scale));
|
||||
outputHeight = Math.Min(maximumHeight, (int)(outputHeight * scale));
|
||||
outputWidth = Math.Min(maximumWidth, Convert.ToInt32(outputWidth * scale));
|
||||
outputHeight = Math.Min(maximumHeight, Convert.ToInt32(outputHeight * scale));
|
||||
}
|
||||
|
||||
outputWidth = 2 * (outputWidth / 2);
|
||||
|
||||
Reference in New Issue
Block a user