I'm not sure that's right. Assuming a 4:3 sensor, the maxPreview size will be 2400x1800 or something.  If the current preview is a 1:1 square that is 1000x1000, then dividing hte widths will give you a max of 2.4 but dividing the heights will give you 1.8.  I think you need to compute both quotients and take the smaller, don't you?