log.warn("Rendition name was not configured in arguments. Skipping.");
return;
}
final Asset asset = getAssetFromPayload(workItem, workflowSession.getSession());
final Rendition rendition = asset.getRendition(new PrefixRenditionPicker(renditionName));
if (rendition == null) {
log.warn("Rendition name {} was not available for asset {}. Skipping.", renditionName, asset);
return;
}
Layer layer = null;
try {
layer = new Layer(rendition.getStream());
layer = processLayer(layer, rendition, workflowSession, args);
String mimetype = layer.getMimeType();
double quality = mimetype.equals("image/gif") ? getQuality(MAX_GIF_QUALITY, qualityStr) : getQuality(1.0,
qualityStr);
saveImage(asset, rendition, layer, mimetype, quality);
} catch (IIOException e) {
log.warn("Unable to load image layer from " + rendition.getPath(), e);
} catch (IOException e) {
log.warn("Unable to load image layer from " + rendition.getPath(), e);
} finally {
if (layer != null) {
layer.dispose();
layer = null;
}