예제 #1
0
        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();
        }
예제 #2
0
        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);
        }