double sampleRatio = ((double)sampleWidth) / sampleHeight;
double resultRatio = ((double)resultWidth) / resultHeight;
v = scale.createValue();
((BooleanValue)v).bool(0 == Double.compare(sampleRatio, resultRatio));
v.setComment(String.format("Reference value: %s\nActual value: %s",
formatter.formatFloat(sampleRatio),formatter.formatFloat(resultRatio)));
} catch (NumberFormatException e) {
// not all values are available - aspectRatio cannot be calculated
v = scale.createValue();
v.setComment("Image width and/or height are not available - aspectRatio cannot be calculated");
}