Let's elaborate the issue with an example:
I have an arbitrary rectangle. Let's choose the rectangle to be $5.6 \times 4.2$. The width-to-height ratio is $\frac 4 3$. The rectangle is in between the two whole-numbered rectangles of $4 \times 3$ and $8 \times 6$, both having the same ratio.

So, given an arbitrary rectangle, how do I find (if any) the closest* rectangle(s) whose sides are both whole numbers and also has (have) the same ratio?
* By closest, I mean the rectangle(s) whose sides have the same ratio, and both sides have a whole-numbered length that are the first possible whole numbers that form such a ratio.
In general, a whole-numbered rectangle with the same ratio exists only if the ratio of width to height is a rational number.
Let's focus on rationals. You have a rectangle with a ratio of $p:q$ where $p,q\in\mathbb Q$. Since $p,q$ are rationals, you can write them as $p=\frac mn$ and $q=\frac op$.
You are looking at the set of all whole-number rectangles with with-to-height ratios of $\frac{p}{q}$. This would be equivalent to the set $$\{(n_1,n_2)|\frac{n_1}{n_2}=\frac pq\}$$
which is the same as
$$\left\{(n_1,n_2)\left|\frac{n_1}{n_2}=\frac{\frac mn}{\frac op}\right.\right\} = \left\{(n_1,n_2)\left|\frac{n_1}{n_2}=\frac{pm}{on}\right.\right\} $$
clearly, one such rectangle one with a width of $pm$ and height of $on$. In general, however, you can simplify the fraction $\frac{pm}{on}$ to get the smallest integer rectangle $(r_1,r_2)$, and then you can show that every rectangle must be of the form $(kr_1,kr_2)$ for some $k\in\mathbb N$. Therefore, if the sides $r_1,r_2$ are smaller than the sides of your triangle, it is possible to find what you are looking for. Otherwise, it is not.