From 7320e103290a98b33a1277cb11cb6db2a0f9f9ba Mon Sep 17 00:00:00 2001 From: JPVenson Date: Sun, 27 Jul 2025 23:12:40 +0000 Subject: readd Format for splashscreen and user image --- Jellyfin.Api/Controllers/ImageController.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Jellyfin.Api/Controllers/ImageController.cs') diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs index c08d18e2d..cd8132d21 100644 --- a/Jellyfin.Api/Controllers/ImageController.cs +++ b/Jellyfin.Api/Controllers/ImageController.cs @@ -1458,6 +1458,7 @@ public class ImageController : BaseJellyfinApiController /// /// User id. /// Optional. Supply the cache tag from the item object to receive strong caching headers. + /// Determines the output format of the image - original,gif,jpg,png. /// Image stream returned. /// User id not provided. /// Item not found. @@ -1473,7 +1474,8 @@ public class ImageController : BaseJellyfinApiController [ProducesImageFile] public async Task GetUserImage( [FromQuery] Guid? userId, - [FromQuery] string? tag) + [FromQuery] string? tag, + [FromQuery] ImageFormat? format) { var requestUserId = userId ?? User.GetUserId(); if (requestUserId.IsEmpty()) @@ -1499,7 +1501,7 @@ public class ImageController : BaseJellyfinApiController ImageType.Profile, null, tag, - ImageFormat.Jpg, + format, null, null, null, @@ -1570,7 +1572,8 @@ public class ImageController : BaseJellyfinApiController [FromQuery] int? imageIndex) => GetUserImage( userId, - tag); + tag, + format); /// /// Get user profile image. @@ -1625,19 +1628,22 @@ public class ImageController : BaseJellyfinApiController [FromQuery] string? foregroundLayer) => GetUserImage( userId, - tag); + tag, + format); /// /// Generates or gets the splashscreen. /// /// Supply the cache tag from the item object to receive strong caching headers. + /// Determines the output format of the image - original,gif,jpg,png. /// Splashscreen returned successfully. /// The splashscreen. [HttpGet("Branding/Splashscreen")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesImageFile] public async Task GetSplashscreen( - [FromQuery] string? tag) + [FromQuery] string? tag, + [FromQuery] ImageFormat? format) { var brandingOptions = _serverConfigurationManager.GetConfiguration("branding"); var isAdmin = User.IsInRole(Constants.UserRoles.Administrator); @@ -1662,7 +1668,7 @@ public class ImageController : BaseJellyfinApiController } } - var outputFormats = GetOutputFormats(ImageFormat.Jpg); + var outputFormats = GetOutputFormats(format); TimeSpan? cacheDuration = null; if (!string.IsNullOrEmpty(tag)) -- cgit v1.2.3