void GeneratePhotoThumbnail(string sourceFile) { var dest = sourceFile.Replace("/lg/", "/xs_sq/", StringComparison.OrdinalIgnoreCase); var gen = new SquareThumbnailGenerator(sourceFile, dest); Directory.CreateDirectory(Path.GetDirectoryName(dest)); gen.Generate(); }
void GenerateVideoThumbnail(string sourceFile) { var destSq = sourceFile.Replace("/raw/", "/thumb_sq/", StringComparison.OrdinalIgnoreCase); var destThumb = sourceFile.Replace("/raw/", "/thumbnails/", StringComparison.OrdinalIgnoreCase); Directory.CreateDirectory(Path.GetDirectoryName(destSq)); destSq = Path.Combine(Path.GetDirectoryName(destSq), Path.GetFileNameWithoutExtension(destSq) + ".jpg"); destThumb = Path.Combine(Path.GetDirectoryName(destThumb), Path.GetFileNameWithoutExtension(destThumb) + ".jpg"); RegenerateVideoThumbnail(sourceFile, destThumb); DumpImageFromVideo(sourceFile, destSq); var gen = new SquareThumbnailGenerator(destSq, destSq); gen.Generate(); DeleteOriginalPngThumbnail(destThumb); }