2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
public static class ImageHelper
|
|
|
|
{
|
2021-03-17 19:46:45 +00:00
|
|
|
public static ImageDimensions GetNewImageSize(ImageProcessingOptions options, ImageDimensions originalImageSize)
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
2021-03-17 19:46:45 +00:00
|
|
|
// Determine the output size based on incoming parameters
|
|
|
|
var newSize = DrawingUtils.Resize(originalImageSize, options.Width ?? 0, options.Height ?? 0, options.MaxWidth ?? 0, options.MaxHeight ?? 0);
|
|
|
|
newSize = DrawingUtils.ResizeFill(newSize, options.FillWidth, options.FillHeight);
|
|
|
|
return newSize;
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|