static int rowsForColsWithAspectRatio(int cols, int w, int h) { ret max(1, iround(cols*(double) h/w)); }