PommaLabs.Thumbnailer.Client 6.0.0

Prefix Reserved
This package has a SemVer 2.0.0 package version: 6.0.0+11db5a83.
There is a newer version of this package available.
See the version list below for details.
dotnet add package PommaLabs.Thumbnailer.Client --version 6.0.0                
NuGet\Install-Package PommaLabs.Thumbnailer.Client -Version 6.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PommaLabs.Thumbnailer.Client" Version="6.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PommaLabs.Thumbnailer.Client --version 6.0.0                
#r "nuget: PommaLabs.Thumbnailer.Client, 6.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PommaLabs.Thumbnailer.Client as a Cake Addin
#addin nuget:?package=PommaLabs.Thumbnailer.Client&version=6.0.0

// Install PommaLabs.Thumbnailer.Client as a Cake Tool
#tool nuget:?package=PommaLabs.Thumbnailer.Client&version=6.0.0                

Thumbnailer Client for .NET

License: MIT Donate Docs NuGet version NuGet downloads

standard-readme compliant GitLab pipeline status Quality gate Code coverage Renovate enabled

A .NET client for Thumbnailer, which wraps v2 endpoints under an easy to use interface.

Table of Contents

Install

NuGet package PommaLabs.Thumbnailer.Client is available for download:

dotnet add package PommaLabs.Thumbnailer.Client

Usage

Client wraps the job-based logic of v2 endpoints under a simpler interface, which hides the details of Thumbnailer jobs and exposes high-level operations such as media optimization and thumbnail generation.

When using dependency injection, client can be registered and configured using following extension method:

using Microsoft.Extensions.DependencyInjection;
using PommaLabs.Thumbnailer.Client;

services.Configure<ThumbnailerClientConfiguration>(Configuration.GetSection("Thumbnailer"));
services.AddThumbnailerClient();

After that, client will be available as an instance of IThumbnailerClient. Client can also be created by instancing following class, providing required objects such as client configuration and a logger:

using PommaLabs.Thumbnailer.Client;
using PommaLabs.Thumbnailer.Client.Services.Clients;

IThumbnailerClient thumbnailerClient = new ConcreteThumbnailerClient(clientConfiguration, logger);

Media optimization can be invoked with following methods:

var optimizedMediaBytes = await thumbnailerClient.OptimizeMediaAsync(
  fileContents, optionalContentType, optionalFileName, optionalCancellationToken);

var optimizedMediaBytes = await thumbnailerClient.OptimizeMediaAsync(
  fileUri, optionalCancellationToken);

Thumbnail generation can be invoked with following methods:

var thumbnailBytes = await thumbnailerClient.GenerateThumbnailAsync(
  fileContents, optionalContentType, optionalFileName,
  /* Thumbnail generation parameters... */, optionalCancellationToken);

var thumbnailBytes = await thumbnailerClient.GenerateThumbnailAsync(
  fileUri, /* Thumbnail generation parameters... */, optionalCancellationToken);

Maintainers

@pomma89.

Contributing

MRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

Contributors

@AlessioGiacobbe implemented new client methods to access image placeholder generation endpoints, which rely on BlurHash and ThumbHash algorithms.

Editing

Visual Studio Code, with Remote Containers extension, is the recommended way to work on this project.

A development container has been configured with all required tools.

Visual Studio Community is also supported and an updated solution file, thumbnailer-dotnet-client.sln, has been provided.

Restoring dependencies

When opening the development container, dependencies should be automatically restored.

Anyway, dependencies can be restored with following command:

dotnet restore

Running tests

Tests can be run with following command:

dotnet test

Tests can also be run with following command, which collects coverage information:

./build.sh --target run-tests

License

MIT © 2019-2023 PommaLabs Team and Contributors

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.2.0 34 11/19/2024
6.1.3 443 3/15/2024
6.1.2 258 12/15/2023
6.1.1 69 12/14/2023
6.1.0 136 11/25/2023
6.0.0 163 6/5/2023
5.1.0 1,005 12/19/2022
5.0.0 94 11/27/2022
4.2.0 448 12/19/2021
4.1.0 456 11/21/2021
4.0.2 193 8/20/2021
3.1.0 1,103 2/7/2021
3.0.0 1,291 11/9/2020
2.1.0 1,068 9/10/2020
2.0.2 1,045 6/19/2020
2.0.1 990 6/11/2020
2.0.0 1,024 6/1/2020
1.7.1 1,067 4/13/2020
1.6.3 1,031 3/29/2020
1.6.0 1,083 3/8/2020