jellyfin/MediaBrowser.Model
vavallee e120b7f2dd Stop image endpoints from upscaling beyond the source resolution
ImageHelper.GetNewImageSize passed the caller-supplied width/height straight
through to SkiaEncoder.EncodeImage, which allocates an SKImageInfo of exactly
that size. Nothing bounded those values against the source image, so a request
like Items/<id>/Images/Primary?width=23100&height=23100 made the server allocate
and resample a 23100x23100 surface from, say, a 600x336 poster: the reporter
measured 100% of a core for 10-15 minutes and 6-12 GB resident per request.
The item images endpoints do not require authentication, so any caller who knows
an item id can trigger this, and varying the size by one pixel misses the cache
every time.

Add DrawingUtils.ScaleDownToFit, which scales a size down uniformly until it
fits inside a bounding box and returns it unchanged if it already does, and
apply it in GetNewImageSize against the original image dimensions. Requests
that ask for more pixels than the source now get the source resolution back,
scaled to the requested aspect ratio. Downscaling paths are untouched, and
DrawingUtils.Resize keeps its existing behaviour for the transcoding callers in
EncodingJobInfo and StreamInfo, which legitimately size video output.
ResizeFill already refused to upscale; this makes width/height consistent
with fillWidth/fillHeight.

Fixes #17056.
2026-08-07 12:33:37 -03:00
..
Activity Add ability to sort and filter activity log entries (#15583) 2025-12-08 21:01:32 -07:00
ApiClient
Branding
Channels Fix CA1819 warnings in ChannelFeatures by using IReadOnlyList 2026-05-14 19:43:58 -05:00
Collections
Configuration Add XML docs to small model enums and remove CS1591 suppressions 2026-07-18 10:08:55 +02:00
Cryptography
Devices
Dlna Allow client-rendered graphical subtitles during remux 2026-08-01 22:49:34 +07:00
Drawing Stop image endpoints from upscaling beyond the source resolution 2026-08-07 12:33:37 -03:00
Dto Add XML docs to small model enums and remove CS1591 suppressions 2026-07-18 10:08:55 +02:00
Entities Add support for VobSub subtitle streams (#16552) 2026-05-31 17:18:25 +02:00
Extensions Run tree-wide dotnet format 2026-05-21 20:48:41 +02:00
Globalization Extract truncation logic to helper and add tests 2026-07-20 22:00:10 +02:00
IO
Library Add XML docs to small model enums and remove CS1591 suppressions 2026-07-18 10:08:55 +02:00
LiveTv Add XML docs to small model enums and remove CS1591 suppressions 2026-07-18 10:08:55 +02:00
Lyrics
MediaInfo Add XML docs to small model enums and remove CS1591 suppressions 2026-07-18 10:08:55 +02:00
MediaSegments Run tree-wide dotnet format 2026-05-21 20:48:41 +02:00
Net fix: add image/jpg to MIME type extension lookup 2026-04-18 15:38:17 +02:00
Notifications
Playlists
Plugins
Properties
Providers Remove global subtitle configuration (#14957) 2026-04-18 17:06:46 +02:00
Querying Apply suggestions from code review 2026-05-15 12:00:00 +02:00
QuickConnect
Search
Serialization
Session Add XML docs to small session model types and remove CS1591 suppressions 2026-07-15 16:03:56 +02:00
Subtitles
SyncPlay Run tree-wide dotnet format 2026-05-21 20:48:41 +02:00
System Fix linting issue 2026-03-24 22:23:48 -04:00
Tasks
Updates
Users Run tree-wide dotnet format 2026-05-21 20:48:41 +02:00
MediaBrowser.Model.csproj Switch to new version scheme (#16758) 2026-05-06 17:41:34 -04:00