Image Resizing
The template has added the Image Resizer-package that can resize requested images on the fly. An additional plugin to handle episerver-files has also been added.
Usage
The image resizer intercepts requests to images and transforms if one of these parameters are set:
- width
- height
- mode
Example of a request using image resizer:
1:
|
|
Helper methods to create a correct url from views are also included in the episerver plugin. The namespace for these is automatically used for all views.
Usage:
1: 2: 3: 4: 5: 6: 7: 8: |
|
See extended documentation here: https://github.com/valdisiljuconoks/ImageResizer.Plugins.EPiServerBlobReader.
Plugins
There are a lot of plugins available for the image resizer.
Note: Some require a license to use.
A list of all plugins can be found here. To install a new plugin, add its nuget-package and add a line for it in ImageResizerInitializer.cs
1:
|
|
Relevant Web.config entries
The resizer must add a couple of lines to the web.config to work.
Under system.webServer, a new module called ImageResizingModule has been added:
1:
|
|
Under system.web/httpModules a new module has been registered
1:
|
|