Eshn.Plugins.FocalPoint
2.0.0
dotnet add package Eshn.Plugins.FocalPoint --version 2.0.0
NuGet\Install-Package Eshn.Plugins.FocalPoint -Version 2.0.0
<PackageReference Include="Eshn.Plugins.FocalPoint" Version="2.0.0" />
<PackageVersion Include="Eshn.Plugins.FocalPoint" Version="2.0.0" />
<PackageReference Include="Eshn.Plugins.FocalPoint" />
paket add Eshn.Plugins.FocalPoint --version 2.0.0
#r "nuget: Eshn.Plugins.FocalPoint, 2.0.0"
#:package Eshn.Plugins.FocalPoint@2.0.0
#addin nuget:?package=Eshn.Plugins.FocalPoint&version=2.0.0
#tool nuget:?package=Eshn.Plugins.FocalPoint&version=2.0.0
Eshn.Plugins.FocalPoint
License
- Eshn.Plugins.FocalPoint is licensed under the Apache License, Version 2.0
- This package is migrated and customized from https://github.com/defsteph/EPiFocalPoint and we use Baaijte.Optimizely.ImageSharp.Web for caching and resizing image.
Installation
Eshn.Plugins.FocalPoint is installed via Optimizely nuget feed
Package Manager
PM > Install-Package Eshn.Plugins.FocalPoint -Version VERSION_NUMBER
.NET CLI
dotnet add package Eshn.Plugins.FocalPoint --version VERSION_NAME
Setup and configuration
Once installed you will need to add the following code to ConfigurationServices and Configure in your Startup.cs file.
public void ConfigureServices(IServiceCollection services) {
// Add the default service and options.
services.AddEPiFocalPointImageSharp();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
// Other middleware registrations
app.UseRouting();
// Add the image processing middleware.
app.UseEpiFocalPointImageSharp();
}
DO NOT add SixLabors.ImageSharp.Web and Baaijte.Optimizely.ImageSharp.Web settings. Additionally, you can't use app.UseBaaijteOptimizelyImageSharp();
Usage
Create or make sure your Image Media ContentTypes inherits from Eshn.Plugins.FocalPoint.FocalPointImageData or implements Eshn.Plugins.FocalPoint.IFocalPointImageData. Remember to decorate the FocalPoint property with [BackingType(typeof(PropertyFocalPoint))] if you want to implement Eshn.Plugins.FocalPoint.IFocalPointImageData manually.
This is example code:
public abstract class ImageFile : ImageData, IFocalPointData
{
[BackingType(typeof(PropertyFocalPoint))]
public virtual FocalPoint? FocalPoint { get; set; }
[ScaffoldColumn(false)]
public virtual int? OriginalWidth { get; set; }
[ScaffoldColumn(false)]
public virtual int? OriginalHeight { get; set; }
}
Disable resize when image width or height is less than expect width or height
var builder = services.AddEPiFocalPointImageSharp(options =>
{
options.IgnoreZoomIn = true;
});
Additional localizations
Embedded localizations are provided for Swedish and English. Should you need to localize in other languages, you can do so by adding XML translations thusly:
<contenttypes>
<imagedata>
<properties>
<focalpoint>
<caption>Focal point</caption>
<help>The point in the image, where the focus should be, automatically cropped images will be calculated based on this point.</help>
</focalpoint>
<originalheight>
<caption>Height</caption>
<help>The image height in pixels.</help>
</originalheight>
<originalwidth>
<caption>Width</caption>
<help>The image width in pixels.</help>
</originalwidth>
</properties>
</imagedata>
</contenttypes>
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Baaijte.Optimizely.ImageSharp.Web (>= 3.0.1)
- EPiServer.CMS.AspNetCore.HtmlHelpers (>= 12.21.4)
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 |
|---|---|---|
| 2.0.0 | 589 | 12/8/2025 |
| 1.0.9 | 2,863 | 10/31/2024 |
| 1.0.8 | 222 | 10/29/2024 |
| 1.0.6 | 282 | 6/30/2023 |
| 1.0.5 | 378 | 6/1/2023 |
| 1.0.4-beta | 303 | 5/26/2023 |
| 1.0.3-beta | 280 | 5/19/2023 |
- Upgrade to .net 8