예제 #1
0
    public static async ValueTask <IThumbnailGenerator> CreateAsync(ThumbnailGeneratorOptions options)
    {
        var result = new ThumbnailGenerator(options);
        await result.InitAsync();

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