|
|
@ -17,6 +17,15 @@ public static partial class ImageManager |
|
|
|
ManipulationEndpoints = configuration.GetSection("ImageManipulation:Templates").Get<List<ImageManipulationImage>>(); |
|
|
|
ManipulationEndpoints = configuration.GetSection("ImageManipulation:Templates").Get<List<ImageManipulationImage>>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static IEnumerable<ImageManipulationImageRead> GetManipulationEndpoints() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return ManipulationEndpoints.Select(e => new ImageManipulationImageRead |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name = e.Name, |
|
|
|
|
|
|
|
TextRequired = e.TextPositions.Count() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static async Task<object> GenerateMemeImageAsync(string template, string[] texts) |
|
|
|
public static async Task<object> GenerateMemeImageAsync(string template, string[] texts) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImageManipulationImage imageTemplate = ManipulationEndpoints.FirstOrDefault(e => e.Name.ToLowerInvariant().Equals(template.ToLowerInvariant())); |
|
|
|
ImageManipulationImage imageTemplate = ManipulationEndpoints.FirstOrDefault(e => e.Name.ToLowerInvariant().Equals(template.ToLowerInvariant())); |
|
|
|