First, some questions.
- Are you using the URL API?
- Are you using the managed or COM API?
If you answered "no" to #1 and "yes" to #2, see our non-web installation guide. Console, WPF, WCF, WinForms, and Classic ASP users sometimes choose to only use the Managed API.
If you answered "yes" to #1, and "no" to #2, you might consider using ImageResizer as a standalone image server. PHP, Ruby, and Python users might consider this, as well as users with dozens of terabytes of images.
Note: If you want to modify Web.config yourself, substitute
ImageResizer.MvcWebConfig below. MvcWebConfig will only add - never delete - elements in Web.config.
via the NuGet Package Manager Console (option 1)
Open the nuget console from Visual Studio via
Library Package Manager >
Package Manager Console.
PM> Install-Package ImageResizer.WebConfig PM> Install-Package ImageResizer.Plugins.DiskCache PM> Install-Package ImageResizer.Plugins.PrettyGifs PM> Install-Package ImageResizer.Plugins.SimpleFilters
via the NuGet GUI (Visual Studio) (option 2)
- Right-click on your project and click "Manage NuGet Packages".
- Select "NuGet Official Package Source"
- Search for "Imazen", using the search bar at the top right
- Select "ImageResizer Web.config Installation (with MVC support)" and choose Install
- Repeat for each desired plugin. All plugins can be safely combined
- Check the documentation for each plugin to see if additional steps are required to activate the plugin. Only some NuGet packages auto-activate the included plugin(s).
View available packages on NuGet
Manual Installation (option 3)
Download and unzip the package. Add
ImageResizer.Plugins.DiskCache.dll, and any other plugin dlls you wish to use to the
/binfolder of the website. If you're using Visual Studio, right click your project and choose "Add Reference" for each of these files instead.
Modify or create the /Web.Config file for your site. Make sure all these elements are added correctly (You may wish to make a backup of Web.config first).
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="resizer" type="ImageResizer.ResizerSection,ImageResizer" requirePermission="false" /> </configSections> <resizer> <!-- Unless you (a) use Integrated mode, or (b) map all requests to ASP.NET, you'll need to add .ashx to your image URLs: image.jpg.ashx?width=200&height=20 --> <pipeline fakeExtensions=".ashx" defaultCommands="autorotate.default=true"/> <plugins> <add name="DiskCache" /> <!-- <add name="PrettyGifs" /> --> <!-- <add name="SimpleFilters" /> --> <!-- <add name="S3Reader" /> --> </plugins> </resizer> <system.web> <httpModules> <!-- This is for IIS7/8 Classic Mode and Cassini--> <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/> </httpModules> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <!-- This is for IIS7/8 Integrated mode --> <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/> </modules> </system.webServer> </configuration>
Start your web site, then visit /resizer.debug.ashx to verify you've done everything correctly. If you ever encounter issues, simply revisit that page to access the self-diagnostics. If you need help, just ask!
Ready to go live?
Review the Best Practices Guide and our license options.
Get an ImageResizer license, which includes disk caching and dozens of other valuable plugins.
Take a look at client-side components like Slimmage.js, which can make responsive images painless. There are many third-party libraries that can make integration easier.
Join the community on Github or on UserVoice