private void checkDimensions(final int width, final int height) {
        if (width <= 0) {
            throw new RasterFormatException("zero or negative width value");
        }
        if (height <= 0) {
            throw new RasterFormatException("zero or negative height value");
        }
    }
Checks for valid dimensions and throws {@link RasterFormatException} if the inputs are invalid.

@param width  image width (must be greater than zero)
@param height image height (must be greater than zero)
@throws RasterFormatException if {@code width} or {@code height} are equal or less than zero
src/main/java/org/apache/commons/imaging/common/ImageBuilder.java