Skip to main content

smart_resize

Function smart_resize 

Source
pub fn smart_resize(h: usize, w: usize) -> Result<(usize, usize), String>
Expand description

smart_resize (HF): round each side to a multiple of 32 preserving aspect ratio, then scale into the [MIN_PIXELS, MAX_PIXELS] area budget.