- public Object format(TemplateContext templateContext, Object data, Map<String, String> parameters) {
- Image image = (Image) data;
- String imageClass = parameters.get("class");
+ public Object format(TemplateContext templateContext, Object data, Map<String, Object> parameters) {
+ Image image = null;
+ if (data instanceof String) {
+ image = core.getImage((String) data, false);
+ } else if (data instanceof Image) {
+ image = (Image) data;
+ }
+ if (image == null) {
+ return null;
+ }
+ String imageClass = String.valueOf(parameters.get("class"));