Use integer arithmetic and fraction reduction to determine the resizing ratio

I include a commit to use Euclid's GCD algorithm and a fraction reduction function to determine the numerator and denominator of the resizing ratio as an irreducible fraction using only integer arithmetic.