pub fn smart_resize(h: usize, w: usize) -> Result<(usize, usize), String>
smart_resize (HF): round each side to a multiple of 32 preserving aspect ratio, then scale into the [MIN_PIXELS, MAX_PIXELS] area budget.