Merge pull request #17569 from vavallee/fix/17056-no-image-upscaling

Stop image endpoints from upscaling beyond the source resolution
This commit is contained in:
Cody Robibero
2026-08-10 16:10:17 -04:00
committed by GitHub
4 changed files with 124 additions and 1 deletions
@@ -11,7 +11,9 @@ namespace MediaBrowser.Controller.Drawing
// 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;
// Never encode larger than the source.
return DrawingUtils.ScaleDownToFit(newSize, originalImageSize);
}
}
}