2
0

ImageHelper.cs 666 B

123456789101112131415161718
  1. #pragma warning disable CS1591
  2. #nullable enable
  3. using MediaBrowser.Model.Drawing;
  4. namespace MediaBrowser.Controller.Drawing
  5. {
  6. public static class ImageHelper
  7. {
  8. public static ImageDimensions GetNewImageSize(ImageProcessingOptions options, ImageDimensions originalImageSize)
  9. {
  10. // Determine the output size based on incoming parameters
  11. var newSize = DrawingUtils.Resize(originalImageSize, options.Width ?? 0, options.Height ?? 0, options.MaxWidth ?? 0, options.MaxHeight ?? 0);
  12. newSize = DrawingUtils.ResizeFill(newSize, options.FillWidth, options.FillHeight);
  13. return newSize;
  14. }
  15. }
  16. }