Update MediaBrowser.Controller/Drawing/ImageHelper.cs

Co-authored-by: Tim Eisele <Tim_Eisele@web.de>
This commit is contained in:
Cody Robibero
2026-08-10 16:10:08 -04:00
committed by GitHub
parent e120b7f2dd
commit 82ecfde2f7
@@ -12,9 +12,7 @@ namespace MediaBrowser.Controller.Drawing
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);
// Never encode larger than the source. Upscaling adds no detail, and the requested
// width/height are caller-controlled, so without this an unauthenticated request can
// pin a CPU and allocate several GB encoding a single image.
// Never encode larger than the source.
return DrawingUtils.ScaleDownToFit(newSize, originalImageSize);
}
}