using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; namespace TimelapseApi.ClassExtensions; public static class Extensions { public static async Task AddAsync(this VideoFileCreator video, Image img) { using(var ms = new MemoryStream()) { img.SaveAsPng(ms); byte[] data =ms.ToArray(); await video.AddAsync(data); } } public static void Add(this VideoFileCreator video,Image img) { using(var ms = new MemoryStream()) { img.SaveAsPng(ms); byte[] data =ms.ToArray(); video.Add(data); } } }