static void Run(Options options) { try { var converter = ImageConverterFactory.Get(options.Source, options.Target); var targetPath = options.TargetPath ?? options.Source.Substring(0, options.Source.LastIndexOf('.')) + '.' + options.Target; converter.Convert(options.Source, targetPath); } catch (Exception e) { Console.WriteLine(e); } }
private static IImageConverter GetImageConverterForResource(string resourceName) { Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName); return(ImageConverterFactory.GetImageConverter(imageStream)); }