feat: enhance file upload and URL sending with optional size parameter

This commit is contained in:
HueByte
2026-02-19 18:27:02 +01:00
parent baebc093f5
commit 3a0ea0d321
7 changed files with 139 additions and 23 deletions
@@ -8,6 +8,17 @@ namespace EchoHub.Server.Services;
public class ImageToAsciiService
{
/// <summary>
/// Returns (width, height) dimensions for the given size code.
/// s = small (40x40), m = medium/default (80x80), l = large (120x120).
/// </summary>
public static (int Width, int Height) GetDimensions(string? size) => size?.ToLowerInvariant() switch
{
"s" => (40, 40),
"l" => (120, 120),
_ => (HubConstants.AsciiArtWidth, HubConstants.AsciiArtHeightHalfBlock),
};
/// <summary>
/// Converts an image to ASCII art using half-block characters (▀▄█) with
/// 24-bit ANSI foreground and background colors for 2x vertical resolution.