// Preview
boolean preview = ConfigurationUtils.isTrue(XPathHelper.valueOf(node, "@preview", xpath), false);
// Scaling mode
String mode = XPathHelper.valueOf(node, "m:scalingmode", xpath);
ImageScalingMode scalingMode = mode == null ? None : ImageScalingMode.parseString(mode);
if (Width.equals(scalingMode) && width <= 0)
throw new IllegalStateException("Width scaling needs positive width");
if (Height.equals(scalingMode) && height <= 0)
throw new IllegalStateException("Height scaling needs positive height");