Skip to content

whyleee/RestImageResize

 
 

Repository files navigation

RestImageResize

Provides an ASP.NET HttpModule that adds support of simple rest API to OpenWaves.ImageTransformations.Web package.


For quick start install Nuget Package RestImageResize (or RestImageResize.EPiServer for EpiServer CMS based site) with nuget Package Manager Console and add image url with query like in following example:

<img src="~/Content/Images/bigcat.JPG?width=1200&height=260&transform=fill" />

Query syntax:

Parameters "width" and "height" - numbers from 0 to 2147483647, if any of them is missed value will be automatically ajusted according to transformation type, for 'fit' transformations missed dimension is ignored for other is treat as unchangeable.

Parameter "transform" can be specified with one of the following values: "fit", "fill", "downFit", "downFill", "crop", "stretch". If parameter is missed - "downFit" value will be used as default. You can configure this behaviour with "RestImageResize.DefautTransform" appSettings configuration section's item.

EPiServer Integration

After installing RestImageResize.EPiServer package, add next code to your initialization module.

For EPiServer 7.5/8+:

OpenWaves.ServiceLocator.SetResolver(new OpenWaves.BasicResolver().RegisterRestImageResize());

For older versions:

OpenWaves.ServiceLocator.SetResolver(new OpenWaves.BasicResolver().RegisterWebImageTransformationModule());

About

Provides HttpModule that adds support of simple rest API to OpenWaves.ImageTransformations.Web package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 42.0%
  • CSS 24.8%
  • HTML 17.6%
  • Classic ASP 8.0%
  • C# 4.0%
  • XSLT 2.5%
  • Other 1.1%