Esempio n. 1
0
            public async ValueTask <IThumbnailGenerator> CreateAsync(ThumbnailGeneratorOptions options)
            {
                var result = new ThumbnailGenerator(options);
                await result.InitAsync();

                return(result);
            }
Esempio n. 2
0
        internal ThumbnailGenerator(ThumbnailGeneratorOptions options)
        {
            _configPath  = options.ConfigDirectoryPath ?? throw new ArgumentNullException(nameof(options.ConfigDirectoryPath));
            _concurrency = options.Concurrency;
            _fileSystem  = options.FileSystem ?? throw new ArgumentNullException(nameof(options.FileSystem));
            _bytesPool   = options.BytesPool ?? BytesPool.Shared;

            _thumbnailGeneratorRepository = new ThumbnailGeneratorRepository(Path.Combine(_configPath, "thumbnails.db"), _bytesPool);
        }