v1.0β is now available. It is backwards compatible with 0.9, but your old croppings will be lost if you choose to downgrade to the old version. Test it in a local environment before you push it into production.
Eksponent CropUp introduces a new concept for "One Crop Suits It All".
CropUp is a simple geometric algorithm for "weighted auto cropping". A focus point and optional "area of interest" are defined (e.g. a face in a group pictures). These are shown instead of random stomachs when the picture needs to be sized to a specific format
It assumes that the editor, if possible, wants to show the entire image uploaded but that's rarely possible. Thus, it's not an online image editor.
ImageResizer.NET is used for resizing in the background
See http://cropup.test.eksponent.com/ for an example.
CAUTION: Contains XSLT-Extensions!
The configuration is optional but may define options for editors to override croppings for specific sizes
The main idea with CropUp is that the editor doesn't have to define a crop area for every format you show on the webpage. However, it is possible to define croppings, and it's a good idea as it allows the editor to: 1. See how the image will appear in different format 2. Manually override one or more of the formats if the the general focus point should be overriden.
<cropUp referenceWidth="620" referenceHeight="480">
<croppings>
<add alias="thumb" name="Thumbnail" width="100" height="100" />
<add alias="portrait" name="Portrait" width="320" height="400" />
<add alias="banner" name="Banner" width="620" height="140" />
</croppings>
</cropUp>
referenceWidth and referenceHeight is used to treat very large and rather small uploaded source images identically.
They control when to crop and when to scale down. The default values are normally great, but if you feel like changing them they should reflect the largest images you normally show in your layout.
Use CropUp.GetUrl to get urls and CropUpHtml.CropUpResponsive to generate markup for client side resizing
@CropUp.GetUrl("~/media/1337/AngryDuck.png", new ImageSizeArguments { Width = 200})
@CropUpHtml.CropUpResponsive("~/Content/Christian.jpg", upscaleStep: 200, style: "width:100%;height:200px")
CropUp.GetUrl, the first parameter is the virtual path to the image. The second parameter controls how to size the image.
Width and Height are optional, and missing parameters will adjust to the image's aspect ratio.
CropAlias can be used to show one of the predefined croppings from the configuration. If not specified width and height from the configuration is used.
CropMode specifies how to adjust the image. The following values are possible:
In Xslt you have two extension methods:
args is a string that specifies how to present the image. Se examples below
This is the general format
(((?<Width>(\-|[0-9]+))x(?<Height>(\-|[0-9]+)))?(?<Alias>[a-z]+)?(?<CropMode>[A-Y])?(?<Zoom>Z)?)
So to create a 300x300 image from a property called listImage on the current node, you would write
<img>
<xsl:attribute name="src">
<xsl:value-of select="Eksponent.CropUp:UrlByMediaId($currentPage/listImage, '300x300')" />
</xsl:attribute>
</img>
In the responsive case you would write
<xsl:value-of select="Eksponent.CropUp:ResponsiveByMediaId(2275, 'p200', null, 'width:100%;height:300px', null)" disable-output-escaping="yes" />
ImageResizer.NET is used to generate images. If ImageResizer.NET disk cache plugin is not installed memory will be used. That is fine for smaller solutions but consider purchasing the "Performance Bundle" from http://imageresizing.net/plugins/bundles/1 for larger solutions to enable disk caching ($99/$250 once for all. CropUp is not affiliated with ImageResizer.NET).