PictureSharp.AspNetCore 0.7.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PictureSharp.AspNetCore --version 0.7.0
                    
NuGet\Install-Package PictureSharp.AspNetCore -Version 0.7.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="PictureSharp.AspNetCore" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PictureSharp.AspNetCore" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="PictureSharp.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PictureSharp.AspNetCore --version 0.7.0
                    
#r "nuget: PictureSharp.AspNetCore, 0.7.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.
#:package PictureSharp.AspNetCore@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PictureSharp.AspNetCore&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=PictureSharp.AspNetCore&version=0.7.0
                    
Install as a Cake Tool

PictureSharp.AspNetCore

Returns PictureSharp images from ASP.NET Core endpoints and reads uploaded images.

using PictureSharp;
using PictureSharp.AspNetCore;

app.MapGet("/thumb/{name}", async (string name, CancellationToken ct) =>
{
    Image image = await Image.LoadAsync(Path.Combine("images", Path.GetFileName(name)),
        new DecoderOptions { TargetSize = new(400, 0) }, ct);
    return Results.Extensions.Image(image, new ImageResultOptions { CacheControl = "public, max-age=86400" });
});

app.MapPost("/upload", async (HttpRequest request) =>
{
    using Image image = await request.ReadImageAsync(new DecoderOptions { MaxInputBytes = 10_000_000 });
    return Results.Ok(new { image.Width, image.Height });
});
  • Chooses WebP, PNG or JPEG (configurable, in server order) from the Accept header with quality values and wildcards; optional 406 Not Acceptable.
  • Encodes into memory first: Content-Type, Content-Length, Vary: Accept, optional Cache-Control, HEAD support and no partial body after a failure. Stops on HttpContext.RequestAborted. Disposes the image unless told not to.
  • ReadImageAsync throws BadHttpRequestException (413) for bodies over DecoderOptions.MaxInputBytes before buffering them; other errors are those of Image.LoadAsync.

Depends only on PictureSharp and the ASP.NET Core shared framework. Guide: Adapters. License: MIT.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
0.9.0 42 10/28/2026
0.8.5 75 10/26/2026
0.8.4 88 10/26/2026
0.8.3 84 10/26/2026
0.8.2 85 10/25/2026
0.8.1 86 10/23/2026
0.8.0 93 10/23/2026
0.7.13 92 10/22/2026
0.7.12 85 10/22/2026
0.7.10 85 10/22/2026
0.7.9 90 10/21/2026
0.7.8 91 10/21/2026
0.7.7 94 10/20/2026
0.7.6 87 10/18/2026
0.7.5 85 10/18/2026
0.7.4 97 10/18/2026
0.7.3 87 10/18/2026
0.7.2 90 10/17/2026
0.7.1 89 10/17/2026
0.7.0 84 10/17/2026
Loading failed

0.7.0: unchanged adapter, released with PictureSharp 0.7.0 (plugin SPI for save configuration, HDR gain maps and metadata). Notes: https://github.com/art-ix/PictureSharp/blob/v0.7.0/docs/releases/release-0.7.0.md