Skip to main content

target_size

Function target_size 

Source
pub fn target_size(w: u32, h: u32, max: u32) -> (u32, u32)
Expand description

Target size for a w x h image with short-side limit max.

Nothing changes unless the long side exceeds max. Then the short side becomes max (landscape fixes the height, everything else the width) and the other side follows with truncation. A wide image whose short side is already under max is therefore scaled up, as in Eagle.