protected override Image GenerateImage(MediaFile videoFile, ThumbnailGenerationOptions options)
        {
            var baseImage = _thumbnailGenerator.Generate(videoFile, options).Image;

            var sizedImage = ResizeImage(baseImage, options.ImageSize.Width, options.ImageSize.Height);
            return sizedImage;
        }
 protected override string GenerateKey(MediaFile videoFile, ThumbnailGenerationOptions options)
 {
     return string.Format("{0}_{1}_{2}",
         videoFile.Id,
         options.PointInTime.ResolveAgainst(videoFile.Duration).ToTicksString(),
         options.ImageSize);
 }
        private ThumbnailImage GenerateThumbnail(MediaFile videoFile, ThumbnailGenerationOptions options, string thumbnailFile)
        {
            _ffmpeg.CreateThumbnailImage(videoFile.Path, options.PointInTime.ResolveAgainst(videoFile.Duration), thumbnailFile);

            var image = _fileManager.LoadImage(thumbnailFile);

            return new ThumbnailImage(image, options.ImageType);
        }
        public void GenerateThumbnails(ThumbnailGenerationOptions options)
        {
            var i = 0;
            var count = _library.Files.All.Count();
            foreach (var file in _library.Files.All)
            {
                _thumbnailGenerator.Generate(file, options);

                ThumbnailGenerated(this, new ThumbnailGeneratedEventArgs(file, ++i, count));
            }
        }
        public ThumbnailImage Generate(MediaFile videoFile, ThumbnailGenerationOptions options)
        {
            string thumbnailFile = CreateUniqueThumbnailFile(TEMP_FILE_NAME_BASE, options.ImageType.Extension);

            try
            {
                return GenerateThumbnail(videoFile, options, thumbnailFile);
            }
            finally
            {
                _fileManager.EnsureFileDeleted(thumbnailFile);
            }
        }
        private Image GetImage(MediaFile videoFile, ThumbnailGenerationOptions options)
        {
            var key = GenerateKey(videoFile, options);
            var file = _cacheLocation + "\\" + key + options.ImageType.Extension;

            var image = LoadImage(file);

            if (image == null)
            {
                image = GenerateImage(videoFile, options);
                SaveImage(image, file);
            }

            return image;
        }
 protected override Image GenerateImage(MediaFile videoFile, ThumbnailGenerationOptions options)
 {
     return _thumbnailGenerator.Generate(videoFile, options).Image;
 }
 protected abstract string GenerateKey(MediaFile videoFile, ThumbnailGenerationOptions options);
 protected abstract Image GenerateImage(MediaFile videoFile, ThumbnailGenerationOptions options);
 public ThumbnailImage Generate(MediaFile videoFile, ThumbnailGenerationOptions options)
 {
     return new ThumbnailImage(GetImage(videoFile, options), options.ImageType);
 }