int imageHeight = image.getHeight(this);
if (imageWidth != -1 && imageHeight != -1) {
// Width and height are already known
if (imageWidth != size.x || imageHeight != size.y) {
throw new InvalidImageException("QuadFlatLayTerrainView.paint got image of size "
+ imageWidth + "x" + imageHeight
+ ", but excepted one of size " + size);
}
// If this would be located outside the if, it might override the