public Size scale(int n, int d) {
        return new Size(width * n / d, height * n / d);
    }
Scale by n / d.

@param n numerator
@param d denominator
@return the scaled size
zxing-android-embedded/src/com/journeyapps/barcodescanner/Size.java