XperienceCommunity.ImageProcessing 1.1.1

dotnet add package XperienceCommunity.ImageProcessing --version 1.1.1                
NuGet\Install-Package XperienceCommunity.ImageProcessing -Version 1.1.1                
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="XperienceCommunity.ImageProcessing" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XperienceCommunity.ImageProcessing --version 1.1.1                
#r "nuget: XperienceCommunity.ImageProcessing, 1.1.1"                
#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 XperienceCommunity.ImageProcessing as a Cake Addin
#addin nuget:?package=XperienceCommunity.ImageProcessing&version=1.1.1

// Install XperienceCommunity.ImageProcessing as a Cake Tool
#tool nuget:?package=XperienceCommunity.ImageProcessing&version=1.1.1                

Xperience Community: Image Processing

Description

This package provides a way to resize images and convert them to webp, jpg, and png formats. It supports images from Media libraries and Content hub items stored as Content item assets.

Library Version Matrix

Xperience Version Library Version
>= 29.1.4 1.0.0

Dependencies

Package Installation

Add the package to your application using the .NET CLI

dotnet add package XperienceCommunity.ImageProcessing

Quick Start

  1. Install NuGet package above.

  2. Add the following configuration to your appsettings.json:

     {
       "ImageProcessing": {
         "ProcessMediaLibrary": true,
         "ProcessContentItemAssets": true
       }
     }
    
    • ProcessMediaLibrary: Set to true to enable image processing for Media library images. Defaults to true.
    • ProcessContentItemAssets: Set to true to enable image processing for Content Hub assets. Defaults to true.
  3. Register the Image Processing middleware using app.UseXperienceCommunityImageProcessing():

     var builder = WebApplication.CreateBuilder(args);
    
     // ...
    
     builder.Services.Configure<ImageProcessingOptions>(builder.Configuration.GetSection("ImageProcessing"));
    
     var app = builder.Build();
    
     app.UseKentico();
    
     // ...
    
     app.UseXperienceCommunityImageProcessing();
    
  4. You should be able to use the width, height, and maxSideSize query parameters on your image URLs to resize the image. Examples:

    1. Resize the Media library image to a width of 100px:
      https://yourdomain.com/getmedia/rest-of-your-asset-url?width=100
      
    2. Resize the Content item asset image to a height of 100px:
      https://yourdomain.com/getContentAsset/rest-of-your-asset-url?height=100
      
  5. You can also use the format query parameter to convert the image to a different format. Allowed values are: webp, jpg and png. Example:

    1. Convert the Media library image to webp:
      https://yourdomain.com/getmedia/rest-of-your-asset-url?format=webp
      
    2. Convert the Content item asset image to png:
      https://yourdomain.com/getContentAsset/rest-of-your-asset-url?format=png
      

Contributing

Feel free to submit issues or pull requests to the repository, this is a community package and everyone is welcome to support.

License

Distributed under the MIT License. See LICENSE.md for more information.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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
1.1.1 116 8/5/2024
1.1.0 65 8/3/2024
1.0.0 115 7/8/2024