// tool will not be used
if (params.containsName(ParameterNames.LEFT_X) &&
params.containsName(ParameterNames.RIGHT_X) &&
params.containsName(ParameterNames.BOTTOM_Y) &&
params.containsName(ParameterNames.TOP_Y)) {
Tool croppingTool =
theToolFactory.getTool("CroppingTool");
pipeline.addTool(croppingTool);
}
// We should guarantee that all other tools works
// with RGB(A) images. However we have an optimized path for
// writing Indexed images as GIFs. The RGB converter tool won't
// do anything in that case unless watermarking is required in
// which case we take the slow route.
pipeline.addTool(theToolFactory.getTool("RGBConverterTool"));
// Add clipping tool if it is needed.
if (params.containsName(ParameterNames.PRESERVE_X_LEFT) ||
params.containsName(ParameterNames.PRESERVE_X_RIGHT)) {
Tool clippingTool =
theToolFactory.getTool("ClippingTool");
pipeline.addTool(clippingTool);
}
// Add resizing tool if it is needed.
if (params.containsName(ParameterNames.IMAGE_WIDTH)) {
Tool resizingTool =
theToolFactory.getTool("ResizingTool");
pipeline.addTool(resizingTool);
}
//Add watermarking tool.
if (params.containsName(ParameterNames.WATERMARK_URL)) {
Tool watermarkingTool =
theToolFactory.getTool("WatermarkingTool");
pipeline.addTool(watermarkingTool);
}
RenderedOp[] ops = null;