ImageRenderer imageRenderer = element.getRenderer(ImageRenderer.class);
if (imageRenderer == null) {
return;
}
NiftyImage image =
renderEngine.createImage(
attributes.get("filename"),
attributes.getAsBoolean("filter", Convert.DEFAULT_IMAGE_FILTER));
if (image == null) {
return;
}
String areaProviderProperty = new ImageModeHelper().getAreaProviderProperty(attributes.getAttributes());
String renderStrategyProperty = new ImageModeHelper().getRenderStrategyProperty(attributes.getAttributes());
ImageMode imageMode = convert.imageMode(areaProviderProperty, renderStrategyProperty);
image.setImageMode(imageMode);
imageRenderer.setImage(image);
imageRenderer.setInset(convert.insetSizeValue(attributes.get("inset"), image.getHeight()));
Size imageDimension = imageMode.getImageNativeSize(image);
if (element.getConstraintWidth() == null) {
element.setConstraintWidth(convert.sizeValue(imageDimension.getWidth() + "px"));
}