Skip to content

ashleyjlive/Baaijte.Optimizely.ImageSharp.Web

 
 

Repository files navigation

License

Note As of version 2.0.0 this package targets .NET6.0 and Optimizely.CMS.Core version 12.5.0 or higher

Installation

Baaijte.OptimizelyImageSharp.Web is installed via the Optimizely NuGet feed

PM > Install-Package Baaijte.Optimizely.ImageSharp.Web -Version VERSION_NUMBER
dotnet add package Baaijte.Optimizely.ImageSharp.Web --version VERSION_NUMBER

Setup and Configuration

Once installed you will need to add the following code to ConfigureServices and Configure in your Startup.cs file.

This installs the the default service and options.

public void ConfigureServices(IServiceCollection services) {
    // Add the default service and options.
    services.AddBaaijteOptimizelyImageSharp();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {

    // Add the image processing middleware.
    app.UseBaaijteOptimizelyImageSharp();
}

DO NOT add other SixLabors.ImageSharp.Web settings!!

Also add using Baaijte.Optimizely.ImageSharp.Web; at the top of your Startup.cs file if it was not automatically added.

Configuration for use with DXP

public void ConfigureServices(IServiceCollection services) {
    services.AddImageSharp()
        .Configure<AzureBlobStorageCacheOptions>(options =>
        {
            options.ConnectionString = _configuration.GetConnectionString("EPiServerAzureBlobs");
            options.ContainerName = "mysitemedia";
        })
        .ClearProviders()
        .AddProvider<BlobImageProvider>()
        .SetCache<AzureBlobStorageCache>();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {

    // Add the image processing middleware.
    app.UseBaaijteOptimizelyImageSharp();
}

About

Use SixLabors.ImageSharp.Web in Optimizely

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%