CropAround plugin

Provided a set of focus rectangles, will crop the image while preserving the specified areas.

Coordinates must be in the source image coordinates.

Requires mode=crop and width and height to be specified to activate.

Installation

  1. Reference ImageResizer.Plugins.Faces.dll
  2. Add <add name="CropAround" /> to the <plugins /> section.

Syntax

  • c.focus=x1,y1,x2,y2
  • c.focus=x1,y1,x2,y2,x1,y2,x2,y2…..
  • c.zoom=true (Crop as closely as possible to rectangles)
  • c.zoom=false (Crop minimally to meet required aspect ratio)
  • c.finalmode=crop|pad|max|stretch|carve (If we can't meet the desired aspect ratio given our constraints, what do we do next?)

Special ability when installed alongside the Faces plugin

  • c.focus=faces - Performs on-the-fly face detection and uses those coordinates. Can be resource intensive, so disk caching is recommended.

This plugin (CropAround plugin) is part of the Elite Edition

Where is the plugins section?

The <plugins> section is located in Web.config, and is nested inside the <resizer> element, which is nested inside <configuration>. For examples, see this sample Web.config file.

Where can I find the dll?

We prefer that you install via NuGet, but you can also find the plugin DLL files in the /dlls/release folder of your download.

How do I typically install a plugin via Web.Config?

  1. In Visual Studio, right click on your project and choose "Add reference". Browse to the plugin DLL and click "OK".
  2. In the <plugins> section of Web.config, insert <add name="PluginName" />
  3. Look at the plugin documentation to see what configuration options (if any) are available.

How do I typically install a plugin via code?