AEM comes with two kinds of image renditions for DAM assets (web and thumbnail). This bundle provides a single servlet which can be used to request DAM image renditions in a prioritized manner.
Special "original" rendition can also be retrieved. However, it is only returned if specifically queried or in the case
that rendition.servlet.redirect.on.missing.rendition
functionality is enabled.
Supported Extensions: jpg, jpeg, png, svg, gif
Supported Rendition Type Selectors: imgw, imgt, imgo
- imgw = web rendition
- imgt = thumbnail rendition
- imgo = original raw image
Supported DAM Rendition MIME Types:
- image/jpeg
- image/png
Rendition Search Priority:
- Rendition must have matching dimensions
- Closest matching rendition type (web, thumbnail)
- Closest matching rendition extension (png, jpeg)
rendition.servlet.redirect.on.wrong.type
: Enabled by default. If request is made to a rendition with the wrong extension, a 302 redirect is returned the the URL with the matching extension. If disabled, then 415 error response is returned.
rendition.servlet.redirect.on.missing.rendition
: Disabled by default. If requested rendition is not found, 404 error response is returned. If enabled, 302 redirect is returned to the original rendition.
/content/dam/path/to/image/example.png/jcr:content/renditions/cq5dam.thumbnail.48.48.png
/content/dam/path/to/image/example.png/jcr:content/renditions/cq5dam.web.1280.1280.jpeg
/content/dam/path/to/image/example.png/jcr:content/renditions/original
Right selector, right extension, right dimensions.
/content/dam/path/to/image/example.png.imgw.1280.1280.jpg
Result
200 Response.
Underlying image is /content/dam/path/to/image/example.png/jcr:content/renditions/cq5dam.web.1280.1280.jpeg
.
Wrong selector, wrong extension, wrong dimensions.
rendition.servlet.redirect.on.wrong.type
= true
rendition.servlet.redirect.on.missing.rendition
= true
/content/dam/path/to/image/example.png.imgt.1281.1281.gif
Result
302 redirect to /content/dam/path/to/image/example.png.imgo.png
.
Underlying image is /content/dam/path/to/image/example.png/jcr:content/renditions/orignal
.
Wrong selector, wrong extension, right dimensions.
rendition.servlet.redirect.on.wrong.type
= true
rendition.servlet.redirect.on.missing.rendition
= true
/content/dam/path/to/image/example.png.imgt.1280.1280.gif
Result
302 redirect to /content/dam/path/to/image/example.png.imgt.1280.1280.jpg
.
Underlying image is /content/dam/path/to/image/example.png/jcr:content/renditions/cq5dam.web.1280.1280.jpeg
.
Wrong selector, right extension, right dimensions.
rendition.servlet.redirect.on.wrong.type
= true
rendition.servlet.redirect.on.missing.rendition
= true
/content/dam/path/to/image/example.png.imgt.1280.1280.jpg
Result
200 response. However, underlying search order will check for a 1280x1280 thumbnail rendition first, before using the web rendition.
Underlying image is /content/dam/path/to/image/example.png/jcr:content/renditions/cq5dam.web.1280.1280.jpeg
.