route the size and byte maths through saturating helpers
This commit is contained in:
@@ -724,7 +724,7 @@ fn compute_output_dims(
|
||||
let cap = width_limit.unwrap_or(u32::MAX);
|
||||
if raw_w > cap {
|
||||
let scale = f64::from(cap) / f64::from(raw_w);
|
||||
let nh = (f64::from(raw_h) * scale).round() as u32;
|
||||
let nh = crate::encode::round_u32(f64::from(raw_h) * scale);
|
||||
(cap, (nh / 2) * 2)
|
||||
} else {
|
||||
((raw_w / 2) * 2, (raw_h / 2) * 2)
|
||||
|
||||
Reference in New Issue
Block a user