Skip to content

Set of editors for EPiServer to allow editor to crop images on the fly.

License

Notifications You must be signed in to change notification settings

dotcraft-limited/dotcrafted.ImageCrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageCrop for EPiServer

Description

Platform Platform

Set of editors for EPiServer to allow editor to crop images on the fly.

##Editors

  • Single Image
  • Multiple Image

Installation

Install-Package ITMeric.ImageCrop

The package can be found in the EPiServer Nuget Feed.

Example usage:

[ImageReference(CropRatio = 1d, AllowedTypes = new [] { typeof(ImageFile)})]
public virtual ImageReference SingleImageReference { get; set; }

[ImageReference(CropRatio = 1d, AllowedTypes = new[] { typeof(ImageFile) })]
public virtual ImageReferenceList ImageReferenceList { get; set; }

Render image (Markup):

The easiest way to render a cropped image is to use GetCropUrl extension method:

@model ITMeric.ImageCrop.Core.ImageReference
    
<img src="@Model.CurrentPage.SingleImageReference.GetCropUrl(width: 100, height: 100)" />

In case you need to provide a fallback image, you can specify fallback optional paramters as follows:

<img src="@Model.CurrentPage.SingleImageReference.GetCropUrl(width: 100, height: 100, fallback: "/fallback.jpg")" />

About

Set of editors for EPiServer to allow editor to crop images on the fly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published