Installing the Image Transformation Handler in a .NET Web application

To make the Image Transformation Handler work in .NET, add Contextual Image Delivery JARs and DLLs to the API (in-process) Server Role.

Procedure

  1. On the SDL Web installation media, navigate to Content Delivery\roles\cid\XXX\ (to be determined).
  2. From this location, extract the file XXX to a target folder of your choice.
  3. From the \bin\lib\ subfolder of your target folder, copy all files into the bin\lib\ folder of your API (in-process) .NET Web application.
  4. From the bin\ subfolder of your target folder, copy all files to the \bin\ folder of your .NET Web application.
  5. If you want to run the image transformer against a customized URL, access the bin\config\ folder of your Web application.
  6. Open cd_ambient_conf.xml for editing.
  7. In the <ExcludedPaths> section, add a subelement <Path>/CUSTOM/PATH</Path>, where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against.
  8. Save and close cd_ambient_conf.xml.
  9. In the root folder of your Web application, open Web.config for editing.
  10. Create a new handler mapping as follows (you can also copy-paste and then edit this section from the file Web_fragment.config located in the installation media folder configuration/samples/):
    <location path="CUSTOM/PATH">
      <system.webServer>
        <handlers>
          <add name="ImageTransformerHandler" verb="*" path="CUSTOM/PATH/*" type="Tridion.Context.Image.Handler.ImageTransformerHandler" />
        </handlers>
      </system.webServer>
    </location>

    where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against. If you do not want to create a customized URL, omit the path attribute from the location element and set to the path attribute of the add element to *.

  11. If you want to restrict access to the transformer, insert a security section directly above the handlers section.
  12. If you want to change the default response buffer size (4 MB) for images being transformed, add a responseBufferLimit attribute to the add element and set it to the desired size in bytes.
  13. If you wish to serve images from the local Web server, and if that host is not running on the default port (80), ensure that the httpRuntime element inside the system.web section has an attribute requestPathInvalidCharacters set to the value shown below (you can also copy-paste and then edit this section from the file Web_fragment.config located in the installation media folder configuration/samples/):
    <system.web>
      <httpRuntime requestPathInvalidCharacters="&lt;,&gt;,*/%,&amp;,\,?" />
    </system.web>
  14. Save and close Web.config.
  15. Start or restart your Web application.