@Override
protected final void doGet(final SlingHttpServletRequest request, final SlingHttpServletResponse response) throws
ServletException, IOException {
final String transformName = PathInfoUtil.getSuffixSegment(request, 0);
final NamedImageTransformer namedImageTransformer = this.namedImageTransformers.get(transformName);
final Image image = this.resolveImage(request);
final String mimeType = this.getMimeType(request, image);
Layer layer = this.getLayer(image);
// Transform the image
layer = namedImageTransformer.transform(layer);
final double quality = (mimeType.equals(MIME_TYPE_GIF) ? IMAGE_GIF_MAX_QUALITY : IMAGE_MAX_QUALITY);
response.setContentType(mimeType);
layer.write(mimeType, quality, response.getOutputStream());