SoundInTheory.Piranha.MediaExtensions.Images
3.1.0
dotnet add package SoundInTheory.Piranha.MediaExtensions.Images --version 3.1.0
NuGet\Install-Package SoundInTheory.Piranha.MediaExtensions.Images -Version 3.1.0
<PackageReference Include="SoundInTheory.Piranha.MediaExtensions.Images" Version="3.1.0" />
<PackageVersion Include="SoundInTheory.Piranha.MediaExtensions.Images" Version="3.1.0" />
<PackageReference Include="SoundInTheory.Piranha.MediaExtensions.Images" />
paket add SoundInTheory.Piranha.MediaExtensions.Images --version 3.1.0
#r "nuget: SoundInTheory.Piranha.MediaExtensions.Images, 3.1.0"
#:package SoundInTheory.Piranha.MediaExtensions.Images@3.1.0
#addin nuget:?package=SoundInTheory.Piranha.MediaExtensions.Images&version=3.1.0
#tool nuget:?package=SoundInTheory.Piranha.MediaExtensions.Images&version=3.1.0
Piranha Media Extensions
Various enhancements to Piranha CMS media
Cropped Image Field
An image field that allows multiple crops on a single image.
Only filesystem storage supported for now.
Supports cropping settings and multiple crops.
//In Piranha WebApplicationBuilder...
options.UseCroppedImageField();
//etc
//In PiranhaApplicationBuilder
options.UseCroppedImageField();
//etc
Then configure in Piranha content/model/etc
[Field, CroppedImageFieldSettings(AspectRatio = 16d / 9d, MinWidth = 100, MinHeight = 100, Crops = new string[] { "Default", "Second Crop" })]
public CroppedImageField TestImageFieldWithSettings { get; set; }
[Field]
public CroppedImageField TestImageFieldWithoutSettings { get; set; }
Image Sharp Providers
Providers and resolvers for ImageSharp.Web
There is both a provider for Piranha Media and limited support for Remote Images as well.
Simply configure...
//In Piranha WebApplicationBuilder...
options.UseImageSharpForMedia((opts) =>
{
opts
//PhysicalFileSystemProvider cannot be first in the list. You can add it later on.
.RemoveProvider<PhysicalFileSystemProvider>()
.Configure<PiranhaMediaImageProviderOptions>(o => o.RootName = "/piranha-media")
.AddProvider<PiranhaMediaImageProvider>()
.Configure<RemoteImageProviderOptions>(o =>
{
o.RootName = "/remote";
//A whitelist is necessary as it prevents any hijacking of your endpoint
o.WhiteList = new List<string>()
{
"upload.wikimedia.org"
//etc
};
})
.AddProvider<RemoteImageProvider>();
});
//etc
//In PiranhaApplicationBuilder
options.UseImageSharpForMedia();
//etc
Gallery Field
Field that supports multiple images
//In Piranha WebApplicationBuilder...
options.UseGalleryField();
//etc
//In PiranhaApplicationBuilder
options.UseGalleryField();
//etc
Then configure in Piranha content/model/etc
[Field]
public GalleryField TestGalleryField { get; set; }
//In your view/wherever you want to access
foreach(var image in TestGalleryField.Images){
//Use as if it's a normal image field.
}
Examples are provided in repo.
Product | Versions 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 is compatible. 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 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 is compatible. 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. |
-
net6.0
- Piranha (>= 10.4.0)
- Piranha.AspNetCore (>= 10.4.0)
- Piranha.Manager (>= 10.4.0)
- SixLabors.ImageSharp (>= 2.1.10)
- SixLabors.ImageSharp.Web (>= 2.0.2)
-
net7.0
- Piranha (>= 10.4.0)
- Piranha.AspNetCore (>= 10.4.0)
- Piranha.Manager (>= 10.4.0)
- SixLabors.ImageSharp (>= 2.1.10)
- SixLabors.ImageSharp.Web (>= 2.0.2)
-
net8.0
- Piranha (>= 12.0.0)
- Piranha.AspNetCore (>= 12.0.0)
- Piranha.Manager (>= 12.0.0)
- SixLabors.ImageSharp (>= 2.1.10)
- SixLabors.ImageSharp.Web (>= 2.0.2)
-
net9.0
- Piranha (>= 12.0.0)
- Piranha.AspNetCore (>= 12.0.0)
- Piranha.Manager (>= 12.0.0)
- SixLabors.ImageSharp (>= 2.1.10)
- SixLabors.ImageSharp.Web (>= 2.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.