| 12345678910111213141516171819202122232425262728293031 | using System.Drawing;using Avalonia.Controls;namespace InABox.Avalonia.Platform{    public class ImageFile(string filename, byte[]? data = null)    {        public string FileName { get; private set; } = filename;        public byte[]? Data { get; set; } = data;    }        public interface IImageTools : ILoggable    {        byte[] CreateVideoThumbnail(byte[] video, int maxwidth, int maxheight);                byte[] CreateThumbnail(byte[] image, int maxwidth, int maxheight);                // Goal - to return a properly rotated, scaled and compressed JPEG Image        Task<ImageFile?> CapturePhotoAsync(TopLevel window, int? compression, Size? constraints);        Task<ImageFile?> PickPhotoAsync(TopLevel window, int? compression, Size? constraints);                Task<ImageFile?> CaptureVideoAsync(TopLevel window);        Task<ImageFile?> PickVideoAsync(TopLevel window);        byte[] RotateImage(byte[] image, float angle, int quality = 100);        byte[] ScaleImage(byte[] image, Size? constraints, int quality = 100);    }}
 |