public static IEnumerable <string> Convert(string path) { var file = Path.GetFileNameWithoutExtension(path); var directory = Path.GetDirectoryName(path); var counter = 1; var cropped = Vectorization.Crop(path); foreach (var selected in cropped) { var traced = Vectorization.Trace(selected); // TODO: move format to config var formatted = string.Format("{0}.{1:D4}.svg", file, counter); var combined = Path.Combine(directory, formatted); File.Move(traced, combined); yield return(combined); counter++; } }
static void Main(string[] args) { if (args.Any()) { var unique = args.Distinct(); var converted = Vectorization.Convert(unique); foreach (var item in converted) { Console.WriteLine(item); } } else { Console.WriteLine("Usage:"); Console.WriteLine("{0} file-1.ext file-2.ext [...] file-n.ext", Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().ManifestModule.Name)); } }