Apache Sling > Sling CMS > Administration > Image Transformations

Image Transformations

Image transformations are used to transform a file from one format to an image format, most commonly in generating thumbnails or sized down renditions.

Transformation Configurations

File transformations should be created per site configuration at via the Configuration Console:

/conf/[conf-name]/files/transformations

Editing a Transformation

Each transformation is defined as a series of handlers which will be executed in order.

The transformations avaiable in the current site can be retrieved using the TransformationManager which is available as a Sling Model.

Transformation Handlers

Transformation handlers handle each step of transforming an image based on the Thumbnailer library.

Currently, there are two provided Transformation Handlers:

To implement a new Transformation Handler, provide a service implementing TransformationHandler, including providing a resource type to configure the transformation handler.

Providing Thumbnails

Thumbnail Providers are used to create renditions of non-image files, for example PDFs or Word documents. There are a number of default providers:

To implement a new Thumbnail Providers, provide a service implementing ThumbnailProvider.

Transformation Servlet

The Transformation Servlet can be used to retrieve tranformed images for any file. The transformed images can be retrieved by using the extensions transform and the suffix of the transformation name to execute + the output extension. For example:

/content/site/a-file.png.transform/a-thumbnail.png

The transformation servlet is integrated into the reference image component.