ImageHelper.cs 649 B

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