Extend EPiServer image handler


I want to implement a custom image resize / caching mechanism on images uploaded as a file and embeded on a page. This could either be set as a URL property on a page type or inserted into an XhtmlString using TinyMCE. 

I have tried adding my hanlders for files with image extensions (*.gif, *.jpg and *.png) to the <system.webServer> <handlers> section in the web.config but these handlers are only being used with static file references. Loading images as EPiServer files does not use these handlers.

How would I go about trying to hook into how episerver handles images so that I can resize and cache on the fly?

Jul 16, 2013 7:04

Depends a little on when and what you want to do. But if you want to resize images on upload you could add event listeners to the diferent events (FileCheckedIn for instance). Allan has done something similar in the past with workflows: Use a workflow to resize images upon upload. When it comes to adding your own handler there should be a location settings for your VPP (depends on which version of EPiServer you're running) where you also need to add your handler.

I would also recommend that you consider using something like ImageResizer for this instead, much easier and much much more powerful.

Hope this helps


Jul 16, 2013 7:57

I just want to utilise server side responsive images. I have a .net handler currently running based off http://adaptive-images.com/

I don't want to clutter the interface with resized images from a workflow and I already have the required functionality working for my responsive images so implementing something like ImageResizer is overkill.

How does ImageResizer hook into handle EPiServer served images?

Jul 16, 2013 8:23

It´s using a http module (interceptormodule).


Jul 16, 2013 8:26

Ok, I'll try installing ImageResizer and see how that is working.


Jul 16, 2013 8:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.