Kavita/API/Entities/Enums/CoverImageSize.cs
Joe Milazzo d134196470
Implemented the ability to allow the admin to change the cover generation size. (#2213)
Changed how covers are merged together. Now a cover image will always be generated for reading list and collections.

Fixed reading list page being a bit laggy due to a missing trackby function.

Reading list page will now show the cover image always. Collection detail page will only hide the image if there is no summary on the collection.
2023-08-14 04:56:09 -07:00

37 lines
782 B
C#

namespace API.Entities.Enums;
public enum CoverImageSize
{
/// <summary>
/// Default Size: 320x455 (wxh)
/// </summary>
Default = 1,
/// <summary>
/// 640x909
/// </summary>
Medium = 2,
/// <summary>
/// 900x1277
/// </summary>
Large = 3,
/// <summary>
/// 1265x1795
/// </summary>
XLarge = 4
}
public static class CoverImageSizeExtensions
{
public static (int Width, int Height) GetDimensions(this CoverImageSize size)
{
return size switch
{
CoverImageSize.Default => (320, 455),
CoverImageSize.Medium => (640, 909),
CoverImageSize.Large => (900, 1277),
CoverImageSize.XLarge => (1265, 1795),
_ => (320, 455)
};
}
}